Apps often store strings that change with a number or a choice in ICU MessageFormat, such as {count, plural, one {# trip} other {# trips}}. Translated as one block, that syntax is easy to break. With ICU MessageFormat turned on in the XML filter, wxrks splits each message into one segment per variant and protects the syntax as tags, so translators only translate words and the exported file stays valid ICU.
💡 Who is this for? Account Admins who save XML filters, Project Managers who set the import settings of one XML file, and Vendors who translate those messages in the Editor.
Contents
How wxrks reads an ICU message
ICU MessageFormat is a syntax for strings whose wording depends on a value. A plural picks a variant by number (one, other, =0…), and a select picks one by a keyword (for example male, female, other). Each variant is a branch.
Take this string:
<value>You completed {trip_count, plural, one {# trip} other {# trips}} today.</value>
With ICU MessageFormat on, wxrks creates three segments:
Segment | What the translator sees |
|---|---|
Branch | 1 trip — tag 1 is the number ( |
Branch | 1 trips |
The sentence around the plural | You completed 1 today. — tag 1 is the whole plural |
The ICU syntax ({trip_count, plural, …}, the branch keywords and #, which stands for the number) becomes numbered tags, and simple placeholders such as {name} become tags too. A message that is only a plural or a select, with no text around it, gives only its branch segments. On export, wxrks rebuilds the full ICU message with the translation of each branch.
Without the option, the whole value is a single segment and only a RegEx for tags can protect the syntax.
Before you start
The option belongs to the Custom XML filter. Set it on a saved filter in Settings > Translation > Filter settings (Account Admins), or on one file in Import settings while creating a project (Project Managers). See How to Save File Parsing Settings as a Reusable Filter.
Set the filter so that only the element with the messages is extracted. For a file whose strings carry a limit, context or screenshots, see How to read character limits, context and reference images from XML string files: ICU works together with Record fields.
Turn on ICU MessageFormat
Open the XML filter (Settings > Translation > Filter settings, then Add filter or Edit) or the file's Import settings, with Custom selected in Filter for XML.
Turn on ICU MessageFormat. It is off by default.
Save the filter, or continue creating the project.
The option applies to files imported after you turn it on. Files already in a project keep the segments they were imported with.
💡 Tip: Run Extraction preview with a sample file before saving: each branch should be listed as its own segment.
Translating ICU segments in the Editor (Vendors)
The branches of a message come first, followed by the sentence around them. Each branch segment shows a badge with the message's argument and its branch, such as trip_count · one or count · =0. Hover it to see the type, for example "ICU plural, branch one".
When you translate:
Translate each branch as a complete phrase for its case:
onefor a single item,otherfor the rest,=0for exactly zero.Keep the tags. In a branch, place the number tag where the number goes in your language; in the outer sentence, place the plural's tag where the whole phrase goes. You can move tags; don't delete them.
Don't type
#yourself. Use the number tag: a#typed into the translation is read as the number in the exported file.Machine translation and Context Sensitive still run on each branch. Context Sensitive also receives the sentence around the branch and the branch's case, so it can agree in number.
⚠️ Warning: Your target language only gets the branches the source file has. If your language needs more plural forms than the source (Russian few and many, for example, when the English file only has one and other), those numbers use the other branch in the app, as ICU does. Write other so it reads acceptably for them.
Character limits with ICU
If the strings have a character limit (read with Record fields), the limit applies to each version of the message that the app can display, not to the sum of all branches: wxrks counts the sentence around the plural plus the longest branch of each plural or select. The Editor counter, the QA check Target exceeds the segment's character limit and the Block mode all use that same count.
Every row of the message shows that same total. For example, with a limit of 30 and You completed {trip_count, plural, one {# trip} other {# trips}} today. translated as "Você completou 1 hoje." with the branches "1 viagem" and "1 viagens", each row shows Max 29 / 30: the outer sentence plus "viagens", the longer branch.
Limitations
Only
pluralandselectare read. Messages in the olderchoiceformat make the import fail.The option is available on XML files only.
Apostrophes can come out doubled in some ICU positions in the exported file. The message is still valid ICU.
Troubleshooting
Problem | Cause and fix |
|---|---|
The import fails with "… has an ICU message in the choice format, which is not supported." | Rewrite that message with |
The import fails with "… has an ICU message that cannot be read: …" | A message has an ICU syntax error, such as an unclosed brace. Fix it in the source file; the message names the problem. |
The import fails with "Could not read … with ICU MessageFormat on." | The file couldn't be read as ICU. Check that the filter extracts only the element with the messages. |
The whole message is still one segment | The file was imported before the option was turned on, or the filter used for it doesn't have ICU MessageFormat on. Import the file again with the right filter. |
A number shows in the wrong place in the app | A |
Related articles



