Pluralization

Last updated: November 07, 2025Author: Jakub Pomykała

Pluralization and message selection is the process of adapting translations to account for different grammatical forms in various languages. Different languages have different rules for pluralization, which can affect how messages are displayed based on for example numerical values.

Pluralization overview

SimpleLocalize aims to unify the pluralization process by providing a consistent way to define and use plural forms across different languages for different file formats. That means you can import and export translations with plural forms in a way that is compatible with the specific requirements of each file format.

For this purpose, SimpleLocalize uses the ICU MessageFormat syntax, which is widely supported and allows for complex message formatting, including pluralization.

Pluralization Example

Let's look at an example of how pluralization works in Android Strings file format for English and Polish languages.

<!-- English -->
<plurals name="numberOfSongsAvailable">
    <item quantity="one">Found one song</item>
    <item quantity="other">Found %d songs</item>
</plurals>
<!-- Polish -->
<plurals name="numberOfSongsAvailable">
    <item quantity="one">Znaleziono jedną piosenkę</item>
    <item quantity="few">Znaleziono %d piosenki</item>
    <item quantity="other">Znaleziono %d piosenek</item>
</plurals>

For the Polish language, there are three plural forms: "one", "few", and "other". Each form corresponds to different numerical values, while English only has two forms: "one" and "other".

Importing Pluralized Translations

When you import these translations into SimpleLocalize, you will see a one translation key numberOfSongsAvailable and for each language, you will have the plural forms defined as per the ICU MessageFormat syntax:

// English
{count, plural, one {Found one song} other {Found # songs}}
// Polish
{count, plural, one {Znaleziono jedną piosenkę} few {Znaleziono # piosenki} other {Znaleziono # piosenek}}
Pluralization in SimpleLocalize

Interchangeability

When you export the translations back to the Android Strings file format, SimpleLocalize will convert the ICU MessageFormat syntax back to the appropriate pluralization format for Android Strings. This ensures that your translations remain consistent and compatible with the file format requirements. Additionally, you can export the same translations to other file formats that support pluralization, such as iOS Strings or Gettext PO files, and SimpleLocalize will handle the conversion accordingly.

Supported Plural Forms

Here are some of the common plural forms supported:

  • zero: Used when the count is 0.
  • one: Used when the count is 1.
  • two: Used when the count is 2.
  • few: Used for small numbers, typically 3-4.
  • many: Used for larger numbers, varies by language.
  • other: Used for all other numbers not covered by the above categories.

You can find the complete list of supported plural forms and their rules in the CLDR documentation.

Message selection

In addition to pluralization, SimpleLocalize also supports message selection based on specific conditions. This allows you to define different messages based on variables other than just numerical counts. For example, you can define messages based on gender or other contextual information.

{gender, select, male {He is logged in} female {She is logged in} other {They are logged in}}

This message selection syntax allows you to provide different translations based on the value of the gender variable.

By using pluralization and message selection in SimpleLocalize, you can ensure that your translations are accurate and contextually appropriate for different languages and scenarios.

Important: "other" is a mandatory plural form according to the ICU standard and must always be included in your translations when using pluralization or message selection.

ICU Message Syntax Tester

You can use the ICU Message Syntax Tester to experiment with and validate your ICU MessageFormat strings.

ICU Message Syntax Tester

Further Reading

Every file format and i18n library has its own way of handling pluralization. For example, in JavaScript, libraries like i18next and FormatJS use ICU MessageFormat syntax for pluralization, while Android and iOS have their own specific formats. To learn more about how different file formats and libraries handle pluralization, check our integrations page where you can find detailed information about each supported file format and library.

If you are interested in learning more about ICU MessageFormat and its capabilities, we wrote a blog post that dives deeper into the topic: ICU message format: Guide to plurals, dates & localization syntax