Localization and Plurals

  • Revision slug: Localization_and_Plurals
  • Revision title: Localization and Plurals
  • Revision id: 58839
  • Created:
  • Creator: Mardak
  • Is current revision? No
  • Comment Add Irish, Arabic, Maltese, Macedonian /* List of Plural Rules */

Revision Content

Usage

You're likely here because you're localizing a .properties file and it had a link to this page. This page is to help explain how to localize these strings so that the correct plural form is shown to the user. E.g., "1 page" vs "2 pages".

Here are a couple terms used in this page to help keep things clear:

  • plural rule: For a given language, there is a grammatical rule on how to change words depending on the number qualifying the word. Different languages can have different rules.
  • plural form: For a particular plural rule, there can be multiple forms of a word such as "page" and "pages". In this case, there are 2 forms, but other languages can have 1 or many more.

If you're here for <tt>pluralRule</tt> in the <tt>chrome/global/intl.properties</tt> file, you'll need to figure out what plural rule to choose for your localization. This plural rule is used to determine how many plural forms are needed for each word that needs to be localized with plurals in mind.

For all other properties files that link to this page, you'll need to provide enough plural forms of the desired word and separate them with semi-colons (;). If you don't know how many plural forms you need, check the <tt>pluralRule</tt> number in <tt>chrome/global/intl.properties</tt> and look up the corresponding entry in the following list of plural rules.

List of Plural Rules

This section contains a list of plural rules ordered by their plural rule number. Each entry indicates how many plural forms are needed when localizing a word. For each entry, there is a list of families and languages in those families to help you figure out if it's the rule you should pick for <tt>pluralRule</tt>. Additionally, there is a brief description of each plural form followed by some sample numbers that fall into that particular form.

For a given plural rule, the order in which the plural forms are listed is the same order you need to localize a word, separated by semi-colons. For example, English uses plural rule 1, and localizing <tt>plurals</tt> would require a string of "plural;plurals" where the first word is the singular form and the second is the general plural form.

Plural rule #0 (1 form)

Families: Asian (Chinese, Japanese, Korean, Vietnamese), Turkic/Altaic (Turkish)
everything: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, …

Plural rule #1 (2 forms)

Families: Germanic (Danish, Dutch, English, Faroese, German, Norwegian, Swedish), Finno-Ugric (Estonian, Finnish, Hungarian), Language isolate (Basque), Latin/Greek (Greek), Semitic (Hebrew), Romanic (Italian, Portuguese, Spanish, Catalan)
is 1: 1
everything else: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, …

Plural rule #2 (2 forms)

Families: Romanic (French, Brazilian Portuguese)
is 0 or 1: 0, 1
everything else: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …

Plural rule #3 (3 forms)

Families: Baltic (Latvian)
is 0: 0
ends in 1, not 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
everything else: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, …

Plural rule #4 (3 forms)

Families: Celtic (Scottish Gaeilge)
is 1: 1
is 2: 2
everything else: 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …

Plural rule #5 (3 forms)

Families: Romanic (Romanian)
is 1: 1
is 0 or ends in 01-20: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, …
everything else: 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, …

Plural rule #6 (3 forms)

Families: Baltic (Lithuanian)
ends in 1, not 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
ends in 0 or ends in 10-20: 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, …
everything else: 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, …

Plural rule #7 (3 forms)

Families: Slavic (Croatian, Serbian, Russian, Ukrainian)
ends in 1, not 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …
everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 65, 66, 67, 68, 69, 70, 75, 76, 77, …

Plural rule #8 (3 forms)

Families: Slavic (Slovak, Czech)
is 1: 1
is 2-4: 2, 3, 4
everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, …

Plural rule #9 (3 forms)

Families: Slavic (Polish)
is 1: 1
ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …
everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 35, 36, 37, 38, 39, 40, 41, 45, 46, 47, 48, 49, 50, 51, 55, 56, 57, 58, 59, 60, 61, 65, 66, 67, 68, …

Plural rule #10 (4 forms)

Families: Slavic (Slovenian, Sorbian)
ends in 01: 1, 101, 201, …
ends in 02: 2, 102, 202, …
ends in 03-04: 3, 4, 103, 104, 203, 204, …
everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, …

Plural rule #11 (5 forms)

Families: Celtic (Irish Gaeilge)
is 1: 1
is 2: 2
is 3-6: 3, 4, 5, 6
is 7-10: 7, 8, 9, 10
everything else: 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, …

Plural rule #12 (4 forms)

Families: Semitic (Arabic)
is 1: 1
is 2: 2
is 0 or 3-10: 0, 3, 4, 5, 6, 7, 8, 9, 10
everything else: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, …

Plural rule #13 (4 forms)

Families: Semitic (Maltese)
is 1: 1
is 0 or ends in 01-10: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, …
ends in 11-19: 11, 12, 13, 14, 15, 16, 17, 18, 19, 111, 112, 113, 114, 115, 116, 117, 118, 119, 211, 212, 213, 214, 215, 216, 217, 218, 219, …
everything else: 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, …

Plural rule #14 (3 forms)

Families: Slavic (Macedonian)
ends in 1: 1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, …
ends in 2: 2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 102, 112, 122, 132, 142, 152, 162, 172, 182, 192, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, …
everything else: 0, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 43, 44, 45, 46, 47, 48, 49, 50, 53, 54, 55, 56, 57, 58, 59, 60, 63, …

Examples

The following are some examples for various languages and a brief thought processes.

French

Some French speaking places treat 0 as plural while others treat it as singular. The only other singular is 1 while everything else is plural. So pick either plural rule #1 or #2.

pluralRule=2
seconds=seconde;secondes
minutes=minute;minutes
hours=heure;heures
days=jour;jours

Like many other times when localizing words, gender agreement might force you to rearrange words in a way that the gender is always the same. (seconde vs jour)

Chinese

A word doesn't change if there is a different number in front of it, so all numbers use the same plural form. With just one plural form, it has to be plural rule #0. For each word to localize, it's just like localizing a single word with no semi-colons needed.

pluralRule=0
seconds=秒
minutes=分
hours=時
days=日

Polish

There's a singular form for 1, a plural form for 2-4, and another for 5-21 at which point 22 is the same as 2. Plural rule #7 has a "ends in 2-4, not 12-14" but the singular form includes everything ending in 1 except 11. Plural rule #9 has the correct singular form for only 1.

pluralRule=9
seconds=sekunda;sekundy;sekund
minutes=minuta;minuty;minut
hours=godzina;godziny;godzin
days=dzień;dni;dni

Even though the last 2 plural forms of "day" are the same, both are still needed because there needs to be 3 plural forms for each word.

Sorbian

There are 4 plural forms: nominative singular, nominative dual, nominative plural, genitive plural. These match up with plural rule #10.

pluralRule=10
seconds=sekunda;sekundźe;sekundy;sekundow
minutes=mjeńšina;mjeńšinje;mjeńšiny;mjeńšin
hours=hodźina;hodźinje;hodźiny;hodźin
days=dźeń;dnjej;dny;dnjow

Testing Extension

To help make sure you pick the right plural rule and provide enough plural forms for strings, you should use the pluralForm Checker extension. After installing the extension, it should be available from the Tools menu.

To use it, list off the property files and properties that you want to check and click the button. The extension will load each property and display the plural forms in a table. Selecting a table entry will populate the bottom box with sample uses of the word for some numbers.

Image:pluralForm-checker.png

Install pluralForm Checker extension

Extension input

It would be good to keep this list updated with all the words that need plural forms. People using the extension can then copy/paste this input.

chrome://mozapps/locale/downloads/downloads.properties=seconds,minutes,hours,days

Credits

Plural Form code first implemented for {{template.Bug(394516)}} - Figure out a remaining-time rounding scheme for minutes -> hours/days
Plural rules and families derived from GNU <tt>gettext</tt> documentation.

Revision Source

<h2 name="Usage"> Usage </h2>
<p>You're likely here because you're localizing a .properties file and it had a link to this page. This page is to help explain how to localize these strings so that the correct plural form is shown to the user. E.g., "1 page" vs "2 pages".
</p><p>Here are a couple terms used in this page to help keep things clear:
</p>
<ul><li> <b>plural rule</b>: For a given language, there is a grammatical rule on how to change words depending on the number qualifying the word. Different languages can have different rules.
</li><li> <b>plural form</b>: For a particular plural rule, there can be multiple forms of a word such as "page" and "pages". In this case, there are 2 forms, but other languages can have 1 or many more.
</li></ul>
<p>If you're here for <tt>pluralRule</tt> in the <tt>chrome/global/intl.properties</tt> file, you'll need to figure out what <i>plural rule</i> to choose for your localization. This plural rule is used to determine how many <i>plural forms</i> are needed for each word that needs to be localized with plurals in mind.
</p><p>For all other properties files that link to this page, you'll need to provide enough plural forms of the desired word and separate them with semi-colons (;). If you don't know how many plural forms you need, check the <tt>pluralRule</tt> number in <tt>chrome/global/intl.properties</tt> and look up the corresponding entry in the following list of plural rules.
</p>
<h2 name="List_of_Plural_Rules"> List of Plural Rules </h2>
<p>This section contains a list of plural rules ordered by their plural rule number. Each entry indicates how many plural forms are needed when localizing a word. For each entry, there is a list of families and languages in those families to help you figure out if it's the rule you should pick for <tt>pluralRule</tt>. Additionally, there is a brief description of each plural form followed by some sample numbers that fall into that particular form.
</p><p>For a given plural rule, the order in which the plural forms are listed is the same order you need to localize a word, separated by semi-colons. For example, English uses plural rule 1, and localizing <tt>plurals</tt> would require a string of "plural;plurals" where the first word is the singular form and the second is the general plural form.
</p>
<h3 name="Plural_rule_.230_.281_form.29"> Plural rule #<i><b>0</b></i> (1 form) </h3>
<p><b>Families</b>: Asian (Chinese, Japanese, Korean, Vietnamese), Turkic/Altaic (Turkish)<br>
<b>everything</b>: <small>0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, …</small><br>
</p>
<h3 name="Plural_rule_.231_.282_forms.29"> Plural rule #<i><b>1</b></i> (2 forms) </h3>
<p><b>Families</b>: Germanic (Danish, Dutch, English, Faroese, German, Norwegian, Swedish), Finno-Ugric (Estonian, Finnish, Hungarian), Language isolate (Basque), Latin/Greek (Greek), Semitic (Hebrew), Romanic (Italian, Portuguese, Spanish, Catalan)<br>
<b>is 1</b>: <small>1</small><br>
<b>everything else</b>: <small>0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, …</small><br>
</p>
<h3 name="Plural_rule_.232_.282_forms.29"> Plural rule #<i><b>2</b></i> (2 forms) </h3>
<p><b>Families</b>: Romanic (French, Brazilian Portuguese)<br>
<b>is 0 or 1</b>: <small>0, 1</small><br>
<b>everything else</b>: <small>2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …</small><br>
</p>
<h3 name="Plural_rule_.233_.283_forms.29"> Plural rule #<i><b>3</b></i> (3 forms) </h3>
<p><b>Families</b>: Baltic (Latvian)<br>
<b>is 0</b>: <small>0</small><br>
<b>ends in 1, not 11</b>: <small>1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …</small><br>
<b>everything else</b>: <small>2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, …</small><br>
</p>
<h3 name="Plural_rule_.234_.283_forms.29"> Plural rule #<i><b>4</b></i> (3 forms) </h3>
<p><b>Families</b>: Celtic (Scottish Gaeilge)<br>
<b>is 1</b>: <small>1</small><br>
<b>is 2</b>: <small>2</small><br>
<b>everything else</b>: <small>0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …</small><br>
</p>
<h3 name="Plural_rule_.235_.283_forms.29"> Plural rule #<i><b>5</b></i> (3 forms) </h3>
<p><b>Families</b>: Romanic (Romanian)<br>
<b>is 1</b>: <small>1</small><br>
<b>is 0 or ends in 01-20</b>: <small>0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, …</small><br>
<b>everything else</b>: <small>20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, …</small><br>
</p>
<h3 name="Plural_rule_.236_.283_forms.29"> Plural rule #<i><b>6</b></i> (3 forms) </h3>
<p><b>Families</b>: Baltic (Lithuanian)<br>
<b>ends in 1, not 11</b>: <small>1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …</small><br>
<b>ends in 0 or ends in 10-20</b>: <small>0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, …</small><br>
<b>everything else</b>: <small>2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, …</small><br>
</p>
<h3 name="Plural_rule_.237_.283_forms.29"> Plural rule #<i><b>7</b></i> (3 forms) </h3>
<p><b>Families</b>: Slavic (Croatian, Serbian, Russian, Ukrainian)<br>
<b>ends in 1, not 11</b>: <small>1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …</small><br>
<b>ends in 2-4, not 12-14</b>: <small>2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …</small><br>
<b>everything else</b>: <small>0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 65, 66, 67, 68, 69, 70, 75, 76, 77, …</small><br>
</p>
<h3 name="Plural_rule_.238_.283_forms.29"> Plural rule #<i><b>8</b></i> (3 forms) </h3>
<p><b>Families</b>: Slavic (Slovak, Czech)<br>
<b>is 1</b>: <small>1</small><br>
<b>is 2-4</b>: <small>2, 3, 4</small><br>
<b>everything else</b>: <small>0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, …</small><br>
</p>
<h3 name="Plural_rule_.239_.283_forms.29"> Plural rule #<i><b>9</b></i> (3 forms) </h3>
<p><b>Families</b>: Slavic (Polish)<br>
<b>is 1</b>: <small>1</small><br>
<b>ends in 2-4, not 12-14</b>: <small>2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …</small><br>
<b>everything else</b>: <small>0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 35, 36, 37, 38, 39, 40, 41, 45, 46, 47, 48, 49, 50, 51, 55, 56, 57, 58, 59, 60, 61, 65, 66, 67, 68, …</small><br>
</p>
<h3 name="Plural_rule_.2310_.284_forms.29"> Plural rule #<i><b>10</b></i> (4 forms) </h3>
<p><b>Families</b>: Slavic (Slovenian, Sorbian)<br>
<b>ends in 01</b>: <small>1, 101, 201, …</small><br>
<b>ends in 02</b>: <small>2, 102, 202, …</small><br>
<b>ends in 03-04</b>: <small>3, 4, 103, 104, 203, 204, …</small><br>
<b>everything else</b>: <small>0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, …</small><br>
</p>
<h3 name="Plural_rule_.2311_.285_forms.29"> Plural rule #<i><b>11</b></i> (5 forms) </h3>
<p><b>Families</b>: Celtic (Irish Gaeilge)<br>
<b>is 1</b>: <small>1</small><br>
<b>is 2</b>: <small>2</small><br>
<b>is 3-6</b>: <small>3, 4, 5, 6</small><br>
<b>is 7-10</b>: <small>7, 8, 9, 10</small><br>
<b>everything else</b>: <small>0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, …</small><br>
</p>
<h3 name="Plural_rule_.2312_.284_forms.29"> Plural rule #<i><b>12</b></i> (4 forms) </h3>
<p><b>Families</b>: Semitic (Arabic)<br>
<b>is 1</b>: <small>1</small><br>
<b>is 2</b>: <small>2</small><br>
<b>is 0 or 3-10</b>: <small>0, 3, 4, 5, 6, 7, 8, 9, 10</small><br>
<b>everything else</b>: <small>11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, …</small><br>
</p>
<h3 name="Plural_rule_.2313_.284_forms.29"> Plural rule #<i><b>13</b></i> (4 forms) </h3>
<p><b>Families</b>: Semitic (Maltese)<br>
<b>is 1</b>: <small>1</small><br>
<b>is 0 or ends in 01-10</b>: <small>0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, …</small><br>
<b>ends in 11-19</b>: <small>11, 12, 13, 14, 15, 16, 17, 18, 19, 111, 112, 113, 114, 115, 116, 117, 118, 119, 211, 212, 213, 214, 215, 216, 217, 218, 219, …</small><br>
<b>everything else</b>: <small>20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, …</small><br>
</p>
<h3 name="Plural_rule_.2314_.283_forms.29"> Plural rule #<i><b>14</b></i> (3 forms) </h3>
<p><b>Families</b>: Slavic (Macedonian)<br>
<b>ends in 1</b>: <small>1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, …</small><br>
<b>ends in 2</b>: <small>2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 102, 112, 122, 132, 142, 152, 162, 172, 182, 192, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, …</small><br>
<b>everything else</b>: <small>0, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 43, 44, 45, 46, 47, 48, 49, 50, 53, 54, 55, 56, 57, 58, 59, 60, 63, …</small><br>
</p>
<h2 name="Examples"> Examples </h2>
<p>The following are some examples for various languages and a brief thought processes.
</p>
<h3 name="French"> French </h3>
<p>Some French speaking places treat 0 as plural while others treat it as singular. The only other singular is 1 while everything else is plural. So pick either plural rule #1 or #2.
</p><p><code>
pluralRule=2<br>
seconds=seconde;secondes<br>
minutes=minute;minutes<br>
hours=heure;heures<br>
days=jour;jours
</code>
</p><p>Like many other times when localizing words, gender agreement might force you to rearrange words in a way that the gender is always the same. (seconde vs jour)
</p>
<h3 name="Chinese"> Chinese </h3>
<p>A word doesn't change if there is a different number in front of it, so all numbers use the same plural form. With just one plural form, it has to be plural rule #0. For each word to localize, it's just like localizing a single word with no semi-colons needed.
</p><p><code>
pluralRule=0<br>
seconds=秒<br>
minutes=分<br>
hours=時<br>
days=日
</code>
</p>
<h3 name="Polish"> Polish </h3>
<p>There's a singular form for 1, a plural form for 2-4, and another for 5-21 at which point 22 is the same as 2. Plural rule #7 has a "ends in 2-4, not 12-14" but the singular form includes everything ending in 1 except 11. Plural rule #9 has the correct singular form for only 1.
</p><p><code>
pluralRule=9<br>
seconds=sekunda;sekundy;sekund<br>
minutes=minuta;minuty;minut<br>
hours=godzina;godziny;godzin<br>
days=dzień;dni;dni
</code>
</p><p>Even though the last 2 plural forms of "day" are the same, both are still needed because there needs to be 3 plural forms for each word.
</p>
<h3 name="Sorbian"> Sorbian </h3>
<p>There are 4 plural forms: nominative singular, nominative dual, nominative plural, genitive plural. These match up with plural rule #10.
</p><p><code>
pluralRule=10<br>
seconds=sekunda;sekundźe;sekundy;sekundow<br>
minutes=mjeńšina;mjeńšinje;mjeńšiny;mjeńšin<br>
hours=hodźina;hodźinje;hodźiny;hodźin<br>
days=dźeń;dnjej;dny;dnjow
</code>
</p>
<h2 name="Testing_Extension"> Testing Extension </h2>
<p>To help make sure you pick the right plural rule and provide enough plural forms for strings, you should use the pluralForm Checker extension. After installing the extension, it should be available from the Tools menu.
</p><p>To use it, list off the property files and properties that you want to check and click the button. The extension will load each property and display the plural forms in a table. Selecting a table entry will populate the bottom box with sample uses of the word for some numbers.
</p><p><img alt="Image:pluralForm-checker.png" src="File:en/Media_Gallery/PluralForm-checker.png">
</p><p><a class="external" href="https://bugzilla.mozilla.org/attachment.cgi?id=298688">Install pluralForm Checker extension</a>
</p>
<h3 name="Extension_input"> Extension input </h3>
<p>It would be good to keep this list updated with all the words that need plural forms. People using the extension can then copy/paste this input.
</p><p><code>
chrome://mozapps/locale/downloads/downloads.properties=seconds,minutes,hours,days
</code>
</p>
<h2 name="Credits"> Credits </h2>
<p>Plural Form code first implemented for {{template.Bug(394516)}} - <i>Figure out a remaining-time rounding scheme for minutes -&gt; hours/days</i><br>
Plural rules and families derived from <a class="external" href="http://www.gnu.org/software/gettext/manual/html_node/gettext_150.html#Plural-forms">GNU <tt>gettext</tt> documentation</a>.
</p>
Revert to this revision