i18n Key Naming for Pluralization Rules
Learn how to structure i18n translation keys for pluralization across languages. Covers ICU MessageFormat, CLDR plural categories, and library-specific patterns for react-i18next, vue-i18n, and Rails.
Detailed Explanation
Naming i18n Keys for Pluralization
Pluralization is one of the most complex aspects of i18n because languages have vastly different plural rules. English has two forms (singular and plural), but Arabic has six, Russian has three, and Japanese has none.
CLDR Plural Categories
The Unicode CLDR (Common Locale Data Repository) defines six plural categories:
| Category | English Example | Used By |
|---|---|---|
zero |
0 items | Arabic, Latvian, Welsh |
one |
1 item | Most languages |
two |
2 items | Arabic, Hebrew, Slovenian |
few |
3 items | Czech, Polish, Russian |
many |
5 items | Arabic, Polish, Russian |
other |
10 items | All languages (required) |
Key Patterns by Library
react-i18next / i18next
{
"items_count_one": "{{count}} item",
"items_count_other": "{{count}} items",
"items_count_zero": "No items"
}
Or with nested structure:
{
"items": {
"count_one": "{{count}} item",
"count_other": "{{count}} items"
}
}
vue-i18n
{
"items_count": "No items | {{count}} item | {{count}} items"
}
Vue-i18n uses pipe-separated values within a single key.
ICU MessageFormat
{
"items_count": "{count, plural, =0 {No items} one {# item} other {# items}}"
}
ICU MessageFormat is the most powerful and language-aware approach, used by next-intl, FormatJS, and Angular.
Rails I18n
en:
items:
count:
zero: "No items"
one: "%{count} item"
other: "%{count} items"
Best Practices for Plural Keys
- Always include the
otherform -- it is the required fallback in all languages - Never hardcode numbers -- use
{{count}}interpolation, not separate keys for each number - Include
zerowhen the empty state has special text -- "No items" vs "0 items" - Test with languages that have complex plural rules -- Arabic, Polish, and Russian catch edge cases
- Use ICU MessageFormat for new projects -- it handles all plural categories and nested selects
Ordinal Plurals
Some languages have ordinal forms (1st, 2nd, 3rd):
{
"place": "{count, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}"
}
This is only available with ICU MessageFormat.
Use Case
Pluralization bugs are among the most visible i18n issues. A missing plural form causes strings like '1 items' or '0 item' to appear in production. Properly structured plural keys ensure that translators provide all required forms for their language and that the i18n library selects the correct form at runtime.
Try It — i18n Key Generator
Related Topics
i18n Key Naming for Buttons and Form Labels
Key Types
i18n Key Naming for Error Messages and Validation
Key Types
i18n Key Structure for React Applications
Framework Guide
i18n Key Structure for Vue Applications
Framework Guide
Translation File Formats Comparison: JSON vs YAML vs Properties vs XLIFF vs PO
File Formats