Why plural rules matter in localization
English has two plural forms: "1 file" and "2 files". Polish has four, Arabic six, Japanese one. A message like{count} files that works in English produces wrong grammar in most other languages. The Unicode CLDR project defines a set of named categories (zero, one, two,few, many, other) and, for each language, the rules that map a number to a category. Your i18n library uses these rules to pick the right message.
Cardinal vs ordinal
Cardinal rules cover counts ("3 files"). Ordinal rules cover positions ("3rd place"). English needs one cardinal form for 1 and another for everything else, but four ordinal forms (1st, 2nd, 3rd, 4th). Most libraries expose them separately: ICU uses plural and selectordinal.
How this tool works
- It reads
Intl.PluralRules from your browser, which ships the CLDR data, so the results match what JavaScript apps get at runtime. - Example numbers are found by testing 0 to 200, a few fractions and large numbers against the rules.
- The ICU skeleton lists only the categories the locale needs. Translators should fill every branch;
other is always required.
Common mistakes
- Reusing the English
one/other pair for every language, which produces "5 plik" instead of "5 plików" in Polish. - Forgetting the
other branch, which makes ICU parsing fail. - Assuming
zero exists everywhere. Only a few languages (Arabic, Latvian, Welsh) use it; English uses other for 0 unless you add an explicit =0 case.
SimpleLocalize stores plurals as ICU messages and converts them to Android <plurals>, iOS.stringsdict and other formats on export. Read more in the pluralization documentation.