Pluralization

If you want to reach a global audience, you need to consider how your product design and code will work for different languages and scripts. One of the challenges you may face is how to handle pluralization. Pluralization accommodates different plural rules across languages. It allows for the display of different messages depending on the quantity selected. These different messages are based on the plural rules of the language.

It's not just singular and plural

For most Western countries, the term plural usually means more than one, or, if we want to think about it in a more technical way, anything that’s countable and different from one (we say, for example, “zero Pins”, even though it’s not necessarily more than one).

There are different types of plurals depending on the language. English has two plural forms: singular and plural, “one Pin” and “five Pins.” Many languages share this simple duality, but quite a few don’t. Chinese has one plural form, and so does Japanese. Russian has four, and Arabic has six!

English
0 Pins
1 Pin
2 Pins
French
0 Epingle
1 Epingle
2 Epingles
Japanese
0 ピン
1 ピン
2 ピン
translate (' {num} Pin', ' {num} Pins', num)
Russian
0 Пинов
1 Пин
2 Пина
5 Пинов
11 Пинов
21 Пин
Visual representation of the term Pin and the different plural forms

What is Pluralization?

Pluralization (p11n) is the process of changing nouns from singular to plural form. Pluralization is complex and surprisingly diverse across languages. It’s the problem we face with i18n keys, which contain a numeric parameter.

When localizing plurals, we often have a dynamic count integer that we use to determine which form to pick. For example, 1 → “one Pin”, 2 → “two Pins”.

Looking at English, we have our two forms, “one” and “other” in localization lingo. Here, we’d need two versions of the message:

  • One → “You’ve created 1 Pin so far!”
  • Other → “You’ve created 30 Pins so far!”
A representation of Pinterest on a cellphone showing the following message: You've created one Pin so far!
A representation of Pinterest on a cellphone showing the following message: You've created thirty Pins so far!
What about languages that require multiple plural forms, like Arabic? Arabic has six plural forms
; Opens a new tab
. If we want accurate translations for the above message, we need six versions. The localization industry has used two different approaches for pluralization in Arabic:
  • Approach 1, for required placeholders: (currently used at Pinterest) is grammatically incorrect but commonly used and acceptable. This approach has been used for in-app strings because a placeholder representing the integer is needed and can’t be omitted. This approach shouldn’t be used in site content where pluralization doesn’t require using placeholders for integers (ex: Help Center, Policy, Marketing content).
  • Approach 2, when placeholders aren’t required: is grammatically correct but could be challenging when used for in-app strings because it requires omitting integer placeholders.
We should aim to use the pluralization libraries that use the grammatically correct forms, and not the commonly acceptable ones.

For required placeholders

This approach is grammatically incorrect yet commonly used and acceptable pluralization (includes integers for 0/1/2). Currently used in Pinterest in-app strings.

For required placeholders
Group of intergers
Intergers range
English source
Arabic
Back-translation
zero
0
We have created {0} pins
لقد أنشأنا {٠} من المنشورات
We have created {0} from pins
one
1
We have created {0} pin
لقد أنشأنا منشوراً {١}
We have created pin {1}
two
2
We have created {0} pins
قد أنشأنا منشورين {٢}
We have created pins {2}
few
3-10
We have created {0} pins
لقد أنشأنا {٣} منشورات
We have created {3} pins
many
11-99, 101+
We have created {0} pins
لقد أنشأنا {١١} منشوراً
We have created {11} pins
other
100, 1000, 10,000+
We have created {0} pins
لقد أنشأنا {١٠٠} منشورٍ
We have created {100} pins

Note: when applying this rule, we should allow translators to move the integer placeholder position and also share the rule with examples in the Pinterest Style Guide.

When placeholders aren't required

This approach is the grammatically correct pluralization (omits integers for 0/1/2).

When placeholders aren't required
Group of intergers
Intergers range
English source
Arabic
Back-translation
zero
0
We have created {0} pins
لم ننشئ أي منشور
We have not created any pins
one
1
We have created {0} pin
لقد أنشأنا منشوراً واحداً
We have created pin one
two
2
We have created {0} pins
لقد أنشأنا منشورين اثنين
We have created pins two
few
3-10
We have created {0} pins
لقد أنشأنا {٣} منشورات
We have created {3} pins
many
11-99, 101+
We have created {0} pins
لقد أنشأنا {١١} منشوراً
We have created {11} pins
other
100, 1000, 10,000+
We have created {0} pins
لقد أنشأنا {١٠٠} منشورٍ
We have created {100} pins
Note:
  • The Internationalization Team—engineering specifically—should check CLDR (Common Locale Data Repository)
    ; Opens a new tab
    to see how this could be implemented for in-app strings
  • When translating for larger contents (websites), the second approach, the grammatically correct one, should be implemented
There’s no one-size-fits-all answer to plural translation. We need a solution that allows selecting the correct plural form for any given language, not just “pick from singular and plural”.

How does pluralization work?

Pluralization allows for the display of different messages depending on the quantity selected. These different messages are based on the plural rules of the language. CLDR uses short, mnemonic tags for these plural categories:

  • zero
  • one (singular)
  • two (dual)
  • few (paucal)
  • many (also used for fractions if they have a separate class)
  • other (required—general plural form—also used if the language only has a single form)

When you have a dynamic string with a placeholder for a numeric value appended to a text (ex: {numPins} Pins), you need to always pluralize your string, even if you know that the number will always be greater than zero.

Mapping to CLDR forms

When writing the source string in English, the singular string “You have {numberMessage} message” maps to CLDR's one form and the plural string “You have {numberMessage}” messages maps to CLDR's other form.

Some languages like Japanese will use a single form (other) in the localized message, whereas Russian will use four forms (one, few, many and other) and Arabic will use six forms (zero, one, two, few, many and other).

See CLDR Plural Rules for more details.

English

en.properties

French

fr.properties

Japanese

ja.properties

Russian

ru.properties

Java Code Snippet

Also see the full documentation at L10nMessages, a Pinterest open source project.

Pluralization in the different Pinterest platforms

Each platform at Pinterest has a special function/macro to handle pluralization:

Real life examples

Source and target examples of wrong pluralization. Correct output should be “1 day”

Example of a table with information of old conversion tags. One of the columns shows Views: 1 days

Timestamp wrongly pluralized

Example of timestamp of a Pin wrongly pluralizared, with the output 'two minute ago'

International design
About International Design abreviations and its meaning

RTL guidelines
A guide to designing surfaces with RTL languages in mind