Template:Plural/doc

From RobotX
Jump to navigation Jump to search

No description yet available.

Usage

{{Plural |shownum= |space= |1= |2= |3= |4= |lang= }}

For most languages, including English, {{Plural | lang=xx | {{{n}}} | singular | plural}} is exactly equivalent to {{#ifeq: {{{n}}} | 1 | singular | plural}}, 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–34 etc. use the paucal form and 5–19, 25–29, 35–39 etc. use the plural).
(ro):
  • For integers between 20 to 100, and for integers whose last two digits are either 00 or make a number in the range from 20 to 99, the preposition de is added in most cases (see Romanian numbers, sections "Preposition de" and "Agreement between number name and modified noun"). To use this, one should explicitly enter the plural form without de as the first plural form, and the one with de as the second plural form.

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

Examples:

  • "{{{n}}} {{Plural | lang=en | {{{n}}} | apple | apples }}"
    • produces: "0 apples", "1 apple", "2 apples", etc.
  • "{{{n}}} {{Plural | lang=fr | {{{n}}} | pomme | pommes }}"
    • produces: "0 pomme", "1 pomme", "2 pommes", etc.

(To do: add more examples)

Template parameters

ParameterDescriptionDefaultStatus
shownum
sn
emptyoptional
spacenbspoptional
1emptyrequired
2emptyrequired
3Plural form (or first plural form for languages with several)emptyrequired
4Second plural form for languages with several plural forms. Required for such languages, unused otherwise.emptyoptional
langlanguage"en" (effectively)suggested

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Localization

This template is not intended to be localized.