ICU MessageFormat checker: will every language get the right plural?

Paste an ICU message or drop your JSON or ARB translation files. You get syntax errors with their column, apostrophes that turn a {placeholder} into literal text, the plural forms each language needs (and the numbers that would fall to other without them), and placeholders a translation dropped or renamed. It runs in your browser; nothing is uploaded.

1. Check one message

2. Check translation files

JSON (flat or nested), formatjs extracted messages ({"key": {"defaultMessage": "…"}}) and Flutter .arb files. The language is read from the file name (fr.json, app_pl.arb, messages.de.json) or an ARB @@locale; correct it in the table if needed.

The same checks in CI

The CLI needs Node.js 20 or later and nothing else. It exits 1 on an error (add --strict to fail on warnings too), so it can stop a release that would show Polish readers "5 plik".

node cli.mjs locales/en.json locales/*.json         # the first file is the source
node cli.mjs app_en.arb app_pl.arb app_ar.arb --strict
node cli.mjs --message "{n, plural, one {# file} other {# files}}" --locale pl

Source and README: ventures/icu-message-check.

Questions

Why does my placeholder show up as {name} instead of the value?

Almost always an apostrophe. In ICU MessageFormat a single apostrophe directly before { starts quoted literal text, so l'{item} or '{name}' prints the braces as written. Write two apostrophes (l''{item}) or use the typographic apostrophe ’, which needs no escaping. The guide to apostrophes in ICU MessageFormat has the full rules.

Which plural categories does a language need?

It depends on the language's CLDR plural rules. English uses one and other; French one, many and other; Polish and Russian one, few, many and other; Arabic all six (zero, one, two, few, many, other); Japanese and Chinese only other. This tool reads the rules from your browser's own CLDR data (Intl.PluralRules) and lists example numbers that would fall to other when a category is missing.

Why is my zero option never used in English?

Because English has no zero category: CLDR puts 0 in other. The keyword zero is only selected in languages whose rules define it, such as Arabic, Welsh and Latvian. For a special text at exactly zero in any language, use the exact selector =0.

Does this work with react-intl, FormatJS, Flutter or ICU4J?

Yes for the message syntax all of them share. The parser follows ICU4J's rules and was checked against the FormatJS parser on 100,000 generated messages; the README lists the few places where ICU and FormatJS differ. FormatJS rich-text tags such as <b>…</b> are read as plain text here. Flutter ARB files and formatjs extracted JSON files can be dropped in directly.

Is a file with no errors guaranteed to translate correctly?

No. The checks cover structure: syntax, quoting, plural categories and placeholders. They cannot tell whether a translation is accurate, whether grammatical gender or case agrees, or whether your app passes the values the messages expect. A native-speaking reviewer is still the check for meaning.