Template:Plural/doc: Difference between revisions
More actions
basic documentation |
fix documentation to match changes to code |
||
| Line 23: | Line 23: | ||
|desc=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 [[m:Magic words#Language-dependent word conversions|<nowiki>{{PLURAL:}}</nowiki> parser function]], except that the language code is given as a parameter. For most languages, including English, <code><nowiki>{{Plural | lang=xx | {{n}} | singular | plural}}</nowiki></code> is exactly equivalent to <code><nowiki>{{#ifeq: {{n}} | 1 | singular | plural}}</nowiki></code>, but for some languages the rules are different and some even have more than one plural form: | |desc=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 [[m:Magic words#Language-dependent word conversions|<nowiki>{{PLURAL:}}</nowiki> parser function]], except that the language code is given as a parameter. For most languages, including English, <code><nowiki>{{Plural | lang=xx | {{n}} | singular | plural}}</nowiki></code> is exactly equivalent to <code><nowiki>{{#ifeq: {{n}} | 1 | singular | plural}}</nowiki></code>, but for some languages the rules are different and some even have more than one plural form: | ||
* {{#language:fr}} ('''fr'''): Zero is considered singular | * {{#language:am}} ('''am'''), {{#language:fr}} ('''fr'''), {{#language:hi}} ('''hi'''), {{#language:hy}} ('''hy'''), {{#language:ln}} ('''ln'''), {{#language:mg}} ('''mg'''), {{#language:pt-br}} ('''pt-br'''), {{#language:ti}} ('''ti'''), {{#language:tl}} ('''tl'''), {{#language:wa}} ('''wa'''): | ||
* {{#language:cs}} ('''cs'''): Czech | *: Zero is considered singular, not plural. | ||
* {{#language:ru}} ('''ru'''): | * {{#language:cs}} ('''cs'''), {{#language:sk}} ('''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. | |||
* {{#language:be}} ('''be'''), {{#language:be-tarask}} ('''be-tarask'''), {{#language:bs}} ('''bs'''), {{#language:hr}} ('''hr'''), {{#language:ru}} ('''ru'''), {{#language:sh}} ('''sh'''), {{#language:sr}} ('''sr'''), {{#language:sr-ec}} ('''sr-ec'''), {{#language:sr-el}} ('''sr-el'''), {{#language:uk}} ('''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. | Currently, only the exceptions listed above are implemented, but others can and should be added as needed. | ||
Revision as of 23:32, 1 April 2010
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 {{PLURAL:}} parser function, except that the language code is given as a parameter. 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), français (fr), हिन्दी (hi), հայերեն (hy), lingála (ln), Malagasy (mg), português do Brasil (pt-br), ትግርኛ (ti), Tagalog (tl), walon (wa):
- Zero is considered singular, not plural.
- čeština (cs), slovenčina (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), bosanski (bs), hrvatski (hr), русский (ru), srpskohrvatski / српскохрватски (sh), српски / srpski (sr), српски (ћирилица) (sr-ec), srpski (latinica) (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.
Usage
{{Plural |lang= |1= |2= |3= |4= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
lang | ISO language code | "en" (effectively) | optional | |
1 | Number | empty | required | |
2 | Singular form | empty | required | |
3 | Plural form (or first plural form for languages with several) | empty | required | |
4 | Second plural form (for languages with several plural forms) | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
Example
{{Plural|lang=en|1|example|examples}}
renders as:
Localization
This template is not intended to be localized.