...
While nouns only have two forms in the English language (example: one singular
– month, other plural
– months), other languages can have up to 6 forms (example, Polish: one
– miesiąc, few
– miesiące, many
– miesięcy, other
– miesiąca). Using ICU plurals syntax, you can encode multiple versions of a particular sentence, depending on the value of a number variable. This is especially useful in the localization industry.
...
The first argument (“num” for “numeral” in this example) is the name of a variable. The application interpreting the syntax will select the appropriate version of the sentence according to the value of this variable.
The second argument (“plural” in this example) states that the variable holds a numeric numerical value. Alternatively, a “select” argument can be used, which specifies that the variable contains a text value corresponding to a keyword.
...
Each keyword is followed by a sentence in curly brackets. These sentences can contain variables in curly brackets, but do not have to do so. You can use '#
' as a number variable in “plural” (instead of writing the full name in curly brackets). If you do not want something (e.g. curly brackets) to be treated as a syntax element, you can escape it using an apostrophe.
...
We also recommend that you always enter a full sentence inside plural syntax, instead of just the word that changes in your source language. This is because, in the target language, more words might need to change in the sentence, to translate it correctly.
You will find more details about these recommendations herein an article concerning ICU plural messages: Formatting Messages.
When creating an ICU plural message, you can use the Online ICU Message Editor to check if it works as you expect.
...
How does XTM Cloud handle
...
the ICU plurals syntax?
To request a configuration that processes the ICU plurals syntax efficiently, you need to create a ticket for the XTM Support team.
...
In JSON files, we can activate our special ICU plurals parser, which interprets the ICU plurals syntax and adds or removes plural forms for translation, depending on the target file.
...
In files whose format is not JSON, no ICU syntax parser is available yet in XTM Cloud. The XTM Support team can only configure custom variables to convert the syntax elements that these non-JSON files contain into inline tags.
Consequently, the ICU plurals syntax is partially protected from modification, but the inline tags must be placed carefully to ensure that everything works as expected.
...