...
Code Block | ||
---|---|---|
| ||
{num, plural, zero {Selected {num} items} one {Selected {num} item} two {Selected {num} items} few {Selected {num} items} many {Selected {num} items} other {Selected {num} items}} |
The first argument (“num” num in this example) is the name of a variable that will be used to choose which version of the sentence should be selected. 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 numerical value. Alternatively, a “select” argument can be used, which specifies that the variable contains a text value corresponding to a keyword(plural or select) indicates whether the variable should be interpreted using pluralization rules or based on specific keywords (for non-numeric values). In general, if the second argument is plural, the variable from the first argument has a numeric value. If the second argument is select, the variable will hold a text value.
Following the two arguments, there is a list of keywords: “zero”, “one”, “two”, “few”, “many”, “other” when using “plural”, or a custom set of keywords when using “select”.
...
Each keyword is followed by a sentence in curly brackets that corresponds to the plural form named by the keyword before it. 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 variable 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.
...
The parser (usually a project-level filter template) needs to be selected before a file is uploaded (during project creation or before uploading a new file is uploaded to the project), as the number of plural forms is adjusted during the initial analysis of a file.
...
Like any other JSON file, other metadata can also be extracted.
Currently, when a JSON file is processed with the ICU parser enabled, you should avoid the following:
...
XTM Cloud does not currently support numbered plural forms in which, for example, a plural version is chosen for a specific number, e.g. . For example, =7 days
can be called a “week” or =0 days
can be called “no days” instead of “0 days”.
When a numbered form is used in the source file, it will not be returned to 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.
...