Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template talk:Separated entries

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Separated entries)
Latest comment: 7 months ago by Gonnym in topic Serial comma

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)Reply

Request to add parameter to Module:Separated entries

[edit]

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)Reply

 Done * Pppery * it has begun... 16:07, 9 November 2024 (UTC)Reply

Serial comma

[edit]

Can an option to use a serial comma be added to Module:Separated entries? So that passing |serial=y to any wrapper templates will enable this? (current usages require manually adding white space also so is sub-par). @User:Sdkb seems to want this option. Gonnym (talk) 16:14, 10 December 2025 (UTC)Reply

Please link to the discussions you reference when putting words in my mouth. Wikipedia:Redirects for discussion/Log/2025 December 5#Template:List with serial comma in this case. Sdkbtalk 17:20, 10 December 2025 (UTC)Reply
My mistake. Striking my request above. To the maintainers, ignore it. --Gonnym (talk) 17:22, 10 December 2025 (UTC)Reply