Template:Plural

This template can be used to select the singular or plural form of a word depending on a number and the grammar rules of a language. It functions more or less like the NaN undefineds parser function, except that the language code is given as a parameter. For most languages, including English,  is exactly equivalent to , but for some languages the rules are different and some even have more than one plural form:


 * (am), (fr),  (hi),  (hy),  (ln),  (mg),  (pt-br),  (ti),  (tl),  (wa):
 * Zero is considered singular, not plural.
 * (cs), (sk):
 * Czech and Slovak have two plural forms: the first, a "paucal" form, is used for the numbers 2, 3 and 4, while the other is used for larger numbers.
 * (be), (be-tarask),  (bs),  (hr),  (ru),  (sh),  (sr),  (sr-ec),  (sr-el),  (uk):
 * Same as above, except that only the last digit matters (but numbers ending in 11–19 are always plural; so 1, 21, 31, etc. all use the singular, 2–4, 22–24, 32–33 etc. use the paucal form and 5–19, 25–29, 25–39 etc. use the plural).

Currently, only the exceptions listed above are implemented, but others can and should be added as needed.

Examples:


 * produces: "0 0 apples", "1 1 apple", "2 2 apples", etc.
 * produces: "0 0 apples", "1 1 apple", "2 2 apples", etc.


 * produces: "0 0 pommes", "1 1 pomme", "2 2 pommes", etc.
 * produces: "0 0 pommes", "1 1 pomme", "2 2 pommes", etc.