As far as I can tell, either the documentation has this template's parameters backwards, or the template is coded backwards. The way it's written, the acronym is the second parameter, whereas the expansion that goes into <abbr title="">is the first parameter. (Which seems very strange; I would expect it the other way around, as documented. ...But fixing it risks breaking every transclusion on the site, assuming they're currently using the "correct" backwards parameters.)
Topic on Template talk:Abbr
Appearance
You are right.
- The entire thing is apparently supposed to be based upon w:en:Template:Abbr.
- However, on establishing here in 2011 the parameter order was the other way around, 1=tooltip and 2=term which is always visible.
- The thing was never documented.
- All existing transclusions here are using the local sequence, I guess. Several thousands, I am afraid.
- Then, in April 2020 but not on April fools day a smart guy showed up and left a copy of English Wikipedia template documentation within the programming page, not within a /doc subpage. The way English Wikipedia is solving problems is the best way it can be done, and every other wiki has to do things exactly in the same way English Wikipedia is doing that.
- Now we have a mismatch between documentation and programming.
- And we have an unknown number of transclusions relying on the parameter order as of 2011, and some relying on the parameter order as documented since 2020.
Enjoy.
OK, I moved the documentation to Template:Abbr/doc, fixed the parameter ordering in the explanation and the TemplateData, added a big scary warning about the reversed parameters, and fleshed the docs out some with examples and more metadata. I also re-borrowed some more of the en:Template:Abbr/doc content, as it's still very much applicable. (Things like the "Linking must be done a particular way" explanation.
I thought of a way we actually could go about fixing the parameters, though it's questionable whether it's worth the bother.
- First, create Template:Abbr2 or Template:AbbrEversed or whatever, as a redirect to Template:Abbr.
- Run a bot to replace all {{Abbr}} transclusions with transclusions of the redirect.
- Once it's done, break the redirect and move Template:Abbr to Template:Abbr2
- At that point we're free to write a new Template:Abbr so it works the right way around.
Even if we did everything that carefully, we'd still have all of the bot-rewritten transclusions that actually use the (previously-)documented en:Template:Abbr parameter order to deal with.
@FeRDNYC: Usually, such things are remedied in a different way:
- Do not create a new template.
- Introduce two named parameters as first meaning.
- Keep the current, traditional, unnamed, numerical parameters as aliases and fallback of the named ones.
- Investigate by a random inspection how often old or reversed order are occurring, and modify immediately those transclusions.
- Run a bot if apparently a very wide majority is using one particular interpretation.
- Create a
class="error"
warning and show plain parameter values if someone is using any unnamed parameter; and remove aliases from /doc.
@PerfektesChaos: While I agree that makes sense in the majority of cases, part of the issue here is the local Template:Abbr failing to follow established syntax used by (should-be-)equivalent templates like en:Template:Abbr. Adding named parameters really doesn't address that issue.
It may not really matter, anyway. It looks like, despite their vast number, nearly all of the current Template:Abbr transclusions are actually indirect uses, due to the transclusion of {{MWReleases}}. Which may be just about the only actual use of {{Abbr}} anywhere on the wiki.
({{MWReleases}}, for the record, was for the longest time using the incorrect (documented, Wikipedia-standard) syntax, but has recently been corrected to use the local Template:Abbr's backwards parameters.)
It will abolish to use any unnamed parameter in future, after bot run has corrected the existing transclusions, hopefully as intended.
- If anybody will show up in future with any unnamed parameter they will receive a warning and both values as plain text are displayed.
- That might be local inhabitants who always used 1=this and 2=that.
- That might be someone who copied a paragraph from enWP and did not notice the local change.
It is a solution of the entire problem, since the ambiguous old-fashioned approach with unnamed parameters is terminated and shall not be supported any longer.
- The situation is quite typical for old templates in 2005 style, since unnamed parameters are ambiguous by nature.
- Modern insertions might use VE and other tools and do not know any parameter name used in programming. They just provide the data in form fields and fine.
@PerfektesChaos: Fair enough. It's not a hill I'm prepared to die on.