Variable
Thanks Nike. Thank you for clarifying this for me. It should be correct. :)
Just to make sure: What about „{0}s“?
{n} is a placeholder where n is an index into an array of replacement values. For instance the string "Hello {0}!" will rendered as "Hello World!" if a 1 element array containing the value "World" is passed into a string replacement function.
Hi Stanley, thank your for your reply. However I am still confused. Would "Hello {0}s!" be rendered as "Hello Worlds!"? Once in a while I stumble over „{0}s“. Cheers
Yes, it would be rendered as "Hello Worlds!". Anything between the curly braces would get replaced.
I looked at how one of the messages is used:
Center.hashof=# of active {0}s
The placeholder gets replaced with "Center" and "Group", so the rendered message becomes "# of active Clients" and "# of active Groups". In this example, it is a patchwork message. I suspect the other messages are like that too.
Thank your for confirming my understanding of this. Luckily I have intuitively translated it as plural. However, this may lead to problems since plural may get complex in some languages, e. g. in German we have „e“, „s“, „en“, etc. Because of that it is imho very important to at least indicate the possible content for the placeholder in the message documentation. I am sure that it is possible to guess the content out of context whilst translating, but guessing always makes me feel unsure in the end. Perhaps there other thoughts on this, too.