Template talk:Separated entries
To help centralise discussions and keep related topics together, Module talk:Separated entries redirects here. |
The contents of the Module:Br separated entries page were merged into Module:Separated entries on 23 July 2015 as a result of a deletion discussion. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
Template:Enum, sandboxed version is better
[edit]The sandboxed version of the {{enum}}
template, which invokes this, works with the comma=
parameter properly; the version in main doesn't. (See the testcases.) Can we move it over? I write here rather than there as I don't think that gets much talk. Si Trew (talk) 09:30, 14 November 2015 (UTC)
Request to add parameter to Module:Separated entries
[edit]It is requested that an edit be made to the fully protected module at Module:Separated entries. (edit · history · last · links · sandbox · edit sandbox · sandbox history · sandbox last edit · sandbox diff · test cases · transclusion count · protection log) This template must be followed by a complete and specific description of the request, so that an editor unfamiliar with the subject matter could complete the requested edit immediately.
Edit requests to fully protected pages should only be used for edits that are either uncontroversial or supported by consensus. If the proposed edit might be controversial, discuss it on the protected page's talk page before using this template. Consider making changes first to the module's sandbox and test them thoroughly here before submitting an edit request. To request that a page be protected or unprotected, make a protection request. When the request has been completed or denied, please add the |
Please copy Module:Separated entries/sandbox to Module:Separated entries. See diff.
Effect of change: The edit does not change the default behavior of the module, but adds a new parameter |dataPlural=
. If dataPlural is non-empty, and either |separator=
or |conjunction=
are set, then the module will emit an empty span with display:none. That span has an attribute "data-plural" which is set to 0 if the module produces only one entry, and 1 if the module produces more than one entry. See the module testcases to see the effect of the change.
Reasoning behind change: Several infoboxes (e.g., {{Infobox settlement}}, {{Infobox person}}) use {{Pluralize from text}} to change the labels of a field depending on the data. For example,
{{Pluralize from text|{{{region|}}}|singular=Region|likely=Region(s)|plural=Regions}}
will analyze |region=
and produce a label depending on whether |region=
is clearly singular, clearly plural, or probably plural. {{Pluralize from text}} uses the logic in Module:Detect singular.
Unfortunately, Module:Detect singular cannot tell the difference between |region=Bosnia and Herzegovina
and |region={{enum|California|Nevada}}
, so the above code will emit "Region(s)" for both cases. Anyone can signal Module:Detect singular that its input is singular or plural, via the empty span described above (implemented for users at {{force singular}} and {{force plural}}).
The proposed edit will allow {{Enum}} to signal to Module:Detect singular that, e.g., {{enum|Bosnia and Herzegovina}}
produces a single entry while {{enum|California|Nevada}}
produces two entries (see Template:Enum/sandbox for proposed change there). The proposed edit will increase the precision of Module:Detect singular hence make infoboxes cleaner with fewer labels that look like "Region(s)".
Thanks for your help! — hike395 (talk) 12:18, 29 October 2024 (UTC)