Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Pluralize from text

Permanently protected template
From Wikipedia, the free encyclopedia
Template documentation[view] [edit] [history] [purge]
WarningThis template is used onapproximately 2,430,000 pages, or roughly 4% of all pages.
To avoid major disruption and server load, any changes should be tested in the template's/sandbox or/testcases subpages, or in your ownuser subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on thetalk page before implementing them.
This template usesLua:

{{Pluralize from text}} is used to detect if a text value is a plural list or not. Its intended usage is for infobox parameters, where the label might need to change from a singular version to a plural version.

For example, if an infobox uses a|nickname= parameter, the label might change fromNickname toNicknames if the text value has more than one nickname.

The output of the template can be forced by including{{force singular}} or{{force plural}} in the generic parameter.

Usage

  • {{Pluralize from text|text|singular=singular output|likely=likely plural output|plural=plural output|link=wikilink}}
  • {{Pluralize from text|text|plural argument|singular output|plural output|wikilink}}

Parameters

There are five named parameters that control the pluralization:

  • |no_comma= – By default,commas (orsemicolons) will cause the text string to be considered plural. Setting|no_comma=1 turns this behavior off.
  • |any_comma= – By default, commas (or semicolons) that are adjacent to digits are singular. Setting|any_comma=1 turns this behavior off.
  • |no_and= – By default, "and" causes a string to be plural. Setting|no_and=1 turns this behavior off.
  • |parse_links= – By default, Wikilinks are considered to be unparseable (singular) objects. Setting|parse_links=1 will allow the parser to read the contents of the Wikilinks and determine whether that makes the string plural.
  • |parse_number= – Setting|parse_number=1 will cause the first integer in the string to determine plurality.

Additional parameters:

  • |likely= – The template makes a decision whether a string is a "likely plural" or a full "plural". The|likely= argument will be the output if the template determines that the string is only "likely plural". If|likely= is not given, "likely plural" and "plural" are treated identically.
  • |link= – If the Wikilink is provided, the returned value will use that as a link, and the output will be the link's display text.

TemplateData

This is theTemplateData for this template used byTemplateWizard,VisualEditor and other tools.See a monthly parameter usage report forTemplate:Pluralize from text in articles based on its TemplateData.

TemplateData for Pluralize from text

Helper template to adjust infobox field labels based on whether value is plural or not
ParameterDescriptionTypeStatus
Generic parameter1
Value of the wikitext parameter with unknown plurality
Example
{{{language|}}}
Contentrequired
Plural argument2
value of the wikitext parameter known to be plural
Example
{{{languages|}}}
Stringoptional
Singular output3
singular
Label for the parameter if the value is singular
Example
Language
Stringoptional
Plural output4
plural
Label for the parameter if the value is plural
Example
Languages
Stringoptional
Wikilink5
link
Page to link to in the label
Example
Language
Page nameoptional
Turn off comma processingno_comma
By default, commas and semicolons indicate plurals. Setting to "yes" turns this off.
Default
No
Booleanoptional
Any comma is pluralany_comma
By default, commas and semicolons that are adjacent to digits are singular. Setting to "yes" turns this behavior off.
Default
No
Booleanoptional
"And" is not pluralno_and
By default, "and" causes a string to be plural. Setting to "yes" turns this behavior off.
Default
No
Booleanoptional
Parse wikilinksparse_links
By default, Wikilinks are considered to be unparseable (singular) objects. Setting to "yes" will allow the parser to read the contents of the Wikilinks and determine whether that makes the string plural.
Default
No
Booleanoptional
Parse numbersparse_number
Setting to "yes" will cause the first integer in the string to determine plurality.
Default
No
Booleanoptional
Likely outputlikely
Output when input is likely, but not certain, to be plural
Stringoptional

Examples

The abovedocumentation istranscluded fromTemplate:Pluralize from text/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Pluralize_from_text&oldid=1064683755"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp