How to manage plurals and variables in JSON translations?

Localazy supports pluralization and dynamic variables in JSON translations, helping you handle language-specific rules with ease.

  • Localazy recognizes JSON objects or arrays that follow standard plural types (e.g. one, other, few, many, zero, etc.).
{
  "items": {
    "one": "You have 1 item.",
    "other": "You have %d items."
  }
}
  • You can also use plural suffixes in keys (e.g. itemOne / itemOther, item_one / item_other, or bracketed forms like item[one] / item[other]) — Localazy can detect and preserve your input format.
  • If you prefer ICU-style plurals, Localazy supports that too (via plural_icu feature). For example:
{
  "items": "{count, plural, one {1 item} other {# items}}"
}

Localazy will convert that into its internal plural handling for each language.

You can include placeholders (like {count}, {name}, %d, etc.) inside your strings. Translators see them and can place them as needed in the translation. Localazy ensures that those placeholders stay intact.

Handling pluralization properly matters for several reasons:

  1. It allows you to handle complex grammar rules (singular, plural, dual, etc.) automatically.
  2. Translators see only the relevant plural forms for their language, reducing confusion and mistakes.
  3. You don’t need to manually code plural logic for every language — Localazy (with your app) will handle the mapping.

Was this article helpful?

Please help us with improving our documentation.
We appreciate all your feedback.

Category

Last updated

27/10/2025