← Back to blogs

ICU Plural Rules with Production Examples

Learn how to write ICU plural messages that work across locales, including exact-number matching, category coverage, and release-safe QA practices.

Pluralization mistakes are among the most common internationalization bugs. A message that seems correct in English can fail in languages that require additional categories such as `few` or `many`.

ICU plural syntax helps you define locale-aware grammatical branches in a single template. Done correctly, it improves readability for translators and reduces custom plural logic in application code.

This article shows practical plural patterns for product teams: empty states, exact matches, category coverage, and rollout checks.

Use exact-match branches for UX-critical states

For user experiences like inbox, notifications, or file lists, zero often needs custom copy. ICU supports exact matches like `=0` so you can distinguish a truly empty state from generic plural behavior.

This pattern improves clarity and removes awkward output such as `0 files` where product copy expects `No files yet`.

  • `{count, plural, =0 {No files} one {# file} other {# files}}`
  • Use exact matches only when content meaning changes significantly

Always include required categories for target locale

Do not assume all locales use only `one` and `other`. Some languages require multiple categories, and missing branches can force incorrect fallback text.

Before translation handoff, check plural rules for each target locale and provide a complete template. This avoids last-minute fixes in QA.

Treat `#` output as user-facing numeric content

The `#` token renders the current plural number with locale-aware formatting. This is useful, but ensure product context is explicit so translators know whether the number refers to selected items, total items, or remaining items.

Ambiguous count semantics create inconsistent copy even when grammar is correct.

Create a plural QA checklist for releases

Include plural messages in your release checklist for critical user journeys: onboarding progress, cart counts, alert badges, and billing summaries.

Test values that hit each branch, not just common ones. A template can pass syntax validation but still contain broken or awkward branch text.

  • Verify `=0` behavior where applicable
  • Verify all locale-required categories are present
  • Verify business meaning of count variable in UI context

Key takeaways

  • Use `=0` for meaningful empty-state copy.
  • Cover locale-required plural categories, not only English patterns.
  • Document count semantics for translators and QA.
  • Test branch-level behavior in real product flows.

Frequently asked questions

Can we use one universal plural template for all locales?

Use a shared source intent, but generate locale-appropriate branches. A single English-centric template is usually not enough for global coverage.

Should plural logic be in code or ICU strings?

For translatable user copy, keep plural logic in ICU messages so translators can adapt grammar correctly per locale.