How to handle pluralization and variations in String Catalog?

Pluralization and text variations are essential for natural-sounding translations. Different languages use different rules — for example, English typically distinguishes between singular and plural (“1 file” vs. “2 files”), while other languages, like Polish or Arabic, have three or more plural forms.

With Xcode’s String Catalog, you can define plural and variant strings directly within the catalog instead of creating multiple separate keys. For example, you might create a single entry for FileCount that includes:

  • English: one = "%d file", other = "%d files"
  • Polish: one = "%d plik", few = "%d pliki", many = "%d plików", other = "%d pliku"

The catalog ensures these rules are applied consistently across all supported languages.

Variations can also be defined for context, such as different messages depending on gender or device type. This keeps everything structured in one place and avoids the confusion of multiple scattered .strings entries.

With Localazy’s integration, pluralization and variations become even easier to manage:

  • Localazy automatically understands the plural forms required by each language.
  • Translators see the proper plural categories (e.g., “one,” “few,” “many”) with clear context, reducing mistakes.
  • Localazy extracts context from XML comments and catalog metadata to give translators more guidance.
  • Translations sync seamlessly back into the String Catalog, ensuring all plural forms and variations are correctly preserved.

This combination makes plural handling smooth, efficient, and reliable — especially when scaling your app to multiple languages.

Was this article helpful?

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

Category

Last updated

02/10/2025