Template talk:Lang

From Team Fortress Wiki
Jump to: navigation, search

Implementing the non-en parameter

I'm currently working on an automatic updater for {{Translation switching}} templates, checking the languages present in all {{lang}} templates. To make this effective, we have to enforce the wiki policy of adding all languages to the {{lang}} template even if the inputs are equal (as a cheap example, {{lang|en=Soldier|de=Soldier|fr=Soldier}}). Though the new parameter could be useful for those cases as well, it's intended for the more technical uses of {{lang}}, for example as seen on {{Cosmetic Nav}} with {{Lang|en=50%|ru=60%}} or on {{Item infobox}} for {{lang|ar=float:left; margin: 0.5em 1 0.5em 0em;}}. It's obvious that adding the other 20/21 languages with the exact same content would result in an unnecessary mess. I'd therefore propose implementing a new parameter that is invoked if the non-en parameter is specified and the language case requested is not specified. { TidB | t | c | wt } 14:54, 12 June 2016 (PDT)

For both of those examples ({{lang|ar=float:left; margin: 0.5em 1 0.5em 0em;}} and {{Lang|en=50%|ru=60%}}), it's not a case of "all languages are the same except english", it's a case of "all languages are the same except <language that is not english>". Adding non-en doesn't really solve either of these.
I think this would be better solved by adding a new template identical to {{lang}} for which we don't expect all languages to be present, and use that template for these cases. Either solution requires updating all such cases anyway, so it sounds like the same amount of work. — Wind 14:03, 19 June 2016 (PDT)
That's a good point and I like this solution. As it is only the template name that matters for me and the template code would stay the same, I think it'd suffice to just create a redirect to the template with a different name. { TidB | t | c | wt } 14:19, 19 June 2016 (PDT)