Difference between revisions of "Template:Plural/doc"

From RimWorld Wiki
Jump to navigation Jump to search
(this doesn't work with the -s and word check actually)
Line 6: Line 6:
 
<code><nowiki>{{</nowiki>Plural|''"value"''|''"text"''<nowiki>}}</nowiki></code>
 
<code><nowiki>{{</nowiki>Plural|''"value"''|''"text"''<nowiki>}}</nowiki></code>
  
* The first parameter can be any value, usually in form of an '''expression'''.
+
* The first parameter can be any value, usually in form of an '''expression'''. This parameter is optional. When it i omitted the template just return the plural form of the second parameter.
 
* The second parameter can be any text including links and templates. It should end with the '''unit''' of the value as this template simply adds an "s" at the end of the text, if the value isn't 1.
 
* The second parameter can be any text including links and templates. It should end with the '''unit''' of the value as this template simply adds an "s" at the end of the text, if the value isn't 1.
  

Revision as of 16:40, 10 January 2024

Usage

This template can be used to properly localise units.

The template has two parameters:

{{Plural|"value"|"text"}}

  • The first parameter can be any value, usually in form of an expression. This parameter is optional. When it i omitted the template just return the plural form of the second parameter.
  • The second parameter can be any text including links and templates. It should end with the unit of the value as this template simply adds an "s" at the end of the text, if the value isn't 1.

Examples

{{Plural|1|component}} produces: 1 component

{{Plural|2|component}} produces: 2 components

{{Plural|1/3 round 2|component}} produces: 0.33 components