String.Translate Arguments

Started by Danetta, January 20, 2017, 05:30:40 AM

Previous topic - Next topic

Danetta

Hello.

I tried to use more arguments in Translate function.
My C# code:
stringBuilder.AppendLine("ContainsBeer".Translate(new object[]
                        {
                            this.wortCount,
                            25,
                            this.ComponentDef_Inside.label
                        }));



XML:
<ContainsBeer>Contains {0} / {1} {2}.</ContainsBeer>

Originally, there were only 2 arguments (0 and 1). Apparently, it is not enough to make it work. I looked into Translator code, but it seems like it should work independent of amount of arguments. Yet I am still getting errors about "index should be >=0 and less then amount of arguments" in console-log output.

Could do that without translate at all with const string, but interested what I am doing wrong.