Product
Services
Solutions
Blog
Back

Working with Plural Forms

Contents

Working with Plural Forms

Plural forms allow you to correctly display texts depending on the number of objects in different languages.

What are plurals and why are they needed

The plural forms problem

Different languages have different rules for plural forms:

English (2 forms):

  • 1 file, 2 files, 5 files

Polish (4 forms):

  • 1 plik, 2 pliki, 5 plików, 1.5 pliku

Slovenian (with two form):

  • 1 datoteka, 2 datoteki, 3 datoteke, 5 datotek

Arabic (6 forms):

  • Even more complex system with additional rules

Solution in Localit.io

Localit.io automatically handles plural rules for each language, allowing you to create correct translations for any number of objects.

Plural rules for popular languages

Language

Number of forms

Example

English

2

1 item, 2 items

Polish

4

1 plik, 2 pliki, 5 plików, 1.5 pliku

Slovenian

4

1 datoteka, 2 datoteki, 3 datoteke, 5 datotek

German

2

1 Datei, 2 Dateien

French

2

1 fichier, 2 fichiers

Czech

4

1 soubor, 2 soubory, 5 souborů, 1.5 souboru

Setting up plural rules for languages

For each language in the project, you can configure custom plural forms:

  1. Go to Project Settings

  2. Select the Languages section

  3. Click on the settings for the desired language

  4. Configure plural rules for that language

132

This allows you to precisely control how plural forms will be handled for each language in your project.

Creating plural keys in Localit.io

In the translation editor

  1. Create a new key or open an existing one

  2. Select "Plural" type for the key

  3. The system will automatically create necessary forms for each language

  4. Fill in translations for each plural form

Custom plural key

When creating a plural key, you can specify a Custom plural key - a custom name that is used:

  • In po/pot/mo files in the msgid_plural field

  • In JSON ICU/Numerical ICU formats to specify the internal variable name

Example of Custom plural key usage in ICU:

{"files": "{count, plural, one {{{count}} file} other {{{count}} files}}"}

Here:

  • files - key name

  • count - custom plural key, which is saved and substituted during export

133

Example plural key

key: "files_count"
type: "plural"
custom_plural_key: "count"

English:
- one: "{{count}} file"
- other: "{{count}} files"

Polish:
- one: "{{count}} plik"
- few: "{{count}} pliki"
- many: "{{count}} plików"
- other: "{{count}} pliku"

Uploading files with plural forms

Configuration for JSON format

When uploading JSON files with plural forms, mandatory select the plural format:

  1. In upload settings find "Plural format"

  2. Choose the appropriate format:

    • JSON object{"one": "text", "other": "text"}

    • ICU/ICU Numerical"{count, plural, one {text} other {texts}}"

    • Symfony"text|texts"

Important: This is necessary for correct identification of plural forms in JSON.

134

Examples of different formats

JSON object (4 forms - Polish):

{"books": {
    "one": "1 książka", 
    "few": "%d książki", 
    "many": "%d książek", 
    "other": "%d książki"}}

JSON object (2 forms - English):

{"books": {
    "one": "1 book", 
    "other": "%d books"}}

JSON string:

{"books": "{\"one\":\"1 książka\",\"few\":\"%d książek\",\"many\":\"%d książek\",\"other\":\"%d książek\"}"}

i18next v4:

{"books_one": "1 książka","books_few": "%d książek", 
  "books_many": "%d książek","books_other": "%d książek"}

ICU format:

{"books": "{books, plural, one {1 książka} few {# książki} many {# książek} other {# książki}}"}

Numerical ICU:

{"books": "{books, plural, =1 {1 książka} few {# książki} many {# książek} other {# książki}}"}

Symfony:

{"books": "1 książka|%d książki|%d książek|%d książki"}

Format for different platforms

Android XML

<plurals name="files_count">
    <item quantity="one">%d plik</item>
    <item quantity="few">%d pliki</item>
    <item quantity="many">%d plików</item>
    <item quantity="other">%d pliku</item></plurals>

iOS .stringsdict

<key>files_count</key><dict>
    <key>NSStringLocalizedFormatKey</key>
    <string>%#@files@</string>
    <key>files</key>
    <dict>
        <key>NSStringFormatSpecTypeKey</key>
        <string>NSStringPluralRuleType</string>
        <key>NSStringFormatValueTypeKey</key>
        <string>d</string>
        <key>one</key>
        <string>%d plik</string>
        <key>few</key>
        <string>%d pliki</string>
        <key>many</key>
        <string>%d plików</string>
        <key>other</key>
        <string>%d pliku</string>
    </dict></dict>

Gettext .po

msgid "files_count"
msgid_plural "count"
msgstr[0] "%d plik"
msgstr[1] "%d pliki"
msgstr[2] "%d plików"
msgstr[3] "%d pliku"

Working with plurals in the editor

Translator interface

In translation mode, plural keys are displayed with separate fields for each form:

  • Zero — for zero (in some languages)

  • One — for singular

  • Two — for dual number

  • Few — for small quantities

  • Many — for large quantities

  • Other — for other cases

135

Plural forms validation

Localit.io automatically checks:

  • Correspondence of the number of forms to language rules

  • Correctness of placeholders in each form

  • Consistency of variables between forms

Exporting plural files

Export settings

When exporting plural keys, the system automatically converts them to the required format:

  1. Choose target platform

  2. Specify file format

  3. Plural forms automatically adapt to the selected format

Conversion between formats

Localit.io automatically converts plurals between different formats during export:

  • JSON objectAndroid XMLiOS .stringsdict

  • Universal placeholders are converted to the required format

  • Correctness of plural rules is preserved

  • Custom plural key is correctly substituted in ICU formats

Sorting order of plural forms

For JSON object, JSON string, ICU, Numerical ICU, Symfony formats, the following order is used:

  1. zero

  2. one

  3. two

  4. few

  5. many

  6. other

For i18next and i18next V4 formats, new keys are sorted alphabetically.

Testing plural forms

Correctness verification

To test plural forms:

  1. Use preview in the editor

  2. Check different counter values (0, 1, 2, 3, 5, 11, 21)

  3. Make sure the correct forms are displayed for each number

  4. Pay special attention to languages with two form (Slovenian, Upper Sorbian)

Common mistakes

Wrong number of forms:

❌ Polish with 2 forms: "plik | plików"
✅ Polish with 4 forms: "plik | pliki | plików | pliku"

Improvement recommendations

Placeholder consistency:

⚠️ May lead to confusion: one: "{{count}} file", other: "{{number}} files"
✅ Better to use: one: "{{count}} file", other: "{{count}} files"

Best practices

Naming plural keys

✅ Good:
- "items_count"
- "messages_unread"
- "files_selected"

❌ Bad:
- "item_plural"
- "message1"
- "file_s"

Working with Custom plural key

  1. Use meaningful namescount, num, quantity

  2. Maintain consistency — same names for similar keys

  3. Document specifics — note specific cases

Working with translators

  1. Explain context — where and how plural is used

  2. Provide examples with different numbers, including special cases (0, 1, 2)

  3. Specify limitations on text length

  4. Add comments to complex cases with two form

Organizing plural keys

  1. Group by functionality — all file counters in one section

  2. Use consistent naming — same pattern for similar keys

  3. Document specifics — note culturally-specific cases

Result

Proper work with plural forms ensures:

  • Correct display of texts for any numbers

  • Professional appearance of the application in all languages

  • User convenience — natural sounding interface

  • Time savings on fixing plural form errors

  • Support for all language features including rare forms like two

Use plural rules settings and Custom plural key for precise control of plural forms in each language of your project.

Grow your business with the help of Localit

Make localization a breeze with our service! Streamline translations, boost collaboration, and maintain a consistent brand style across all your content!
Try for free
Ready to simplify your localization process?
Transform your localization process with Localit! Simplify translations, automate workflows, and boost your global reach effortlessly.
Start for Free Today
Alex Abakumov
Сopywriter Localit
Alex Abakumov is a skilled B2B and B2C copywriter based in Brussels with 4+ years of experience crafting compelling content. When not writing, he’s walking his German shepherd, traveling to new places, or trying to get the hottest music tickets in town.