Module:Detect singular/doc: Difference between revisions
From Kenshi Wiki
More actions
Created page with "<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{documentation subpage}} {{Lua|Module:Arguments|Module:Yesno|Module:Text}} Lua to determine whether a string is singular or plural. Designed for use in infoboxes, to determine whether labels should be singular or plural based on the corresponding data, e.g. <code><nowiki>{{#invoke:Detect singular|pluralize|Wynken, Blynken, and Nod||singular|plural}}</nowiki></code> → {{#inv..." |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
<includeonly>{{Sandbox other|| | <includeonly>{{Sandbox other|| | ||
<!-- Categories below this line; interwikis at Wikidata --> | <!-- Categories below this line; interwikis at Wikidata --> | ||
[[Category:Modules]] | |||
[[Category:Infobox modules]] | [[Category:Infobox modules]] | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
[[Category:Module | [[Category:Module documents]] | ||
</noinclude> | </noinclude> |
Latest revision as of 21:10, 11 March 2025
This is a documentation subpage for Module:Detect singular. It may contain usage information, categories and other content that is not part of the original module page. |
Uses Lua: |
Lua to determine whether a string is singular or plural. Designed for use in infoboxes, to determine whether labels should be singular or plural based on the corresponding data, e.g.
{{#invoke:Detect singular|pluralize|Wynken, Blynken, and Nod||singular|plural}}
→ plural
- See Template:Detect singular for main() usage. Test cases here.
- See Template:Pluralize from text for pluralize() usage (a wrapper around main()). Test cases here.