ފަންވަތް:Detect singular/doc
This is a documentation subpage for ފަންވަތް:Detect singular. It contains usage information, categories and other content that is not part of the original ފަންވަތް page. |
This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
Template:Detect singular is used to detect possible lists and is a useful tool for infoboxes, where the label may be singular (e.g., "Nickname:") but the data may be a list.
Usage
އުނިއިތުރު ގެންނަވާ{{Detect singular|value}}
Returns 1 if not a list, nil if a possible list.
Parameters
އުނިއިތުރު ގެންނަވާParameter | Description |
---|---|
1
|
Required. The data to search for a list. |
Options
އުނިއިތުރު ގެންނަވާThere are four named arguments that control the pluralization:
|no_comma=
By default, commas (or semi-colons) will cause the text string to be considered plural. Setting|no_comma=1
turns this behavior off.|any_comma=
By default, commas (or semi-colons) 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.
Overrides
އުނިއިތުރު ގެންނަވާTo force a particular result, place ފަންވަތް:T or ފަންވަތް:T within the text.
Examples
އުނިއިތުރު ގެންނަވާ{{Detect singular|Mack the Knife}}
→ 1
{{Detect singular|May 4, 2020|no_comma=yes}}
→ 1
{{Detect singular|Mack the Knife, Joe}}
→
{{Detect singular|
→
{{hlist|first|second|third}}
}}
{{Detect singular|*one *two *three}}
→
{{Detect singular|Charles, Prince of Wales}}
→ 1
{{Detect singular|Dave Nellist}}
→ 1
Override these errors like this:
{{Detect singular|Charles, Prince of Wales