Localized templates

Hi,

whats you opinion on localized templates? I became aware of this issue as someone created a german version of the wiki labels: http://wiki.openstreetmap.org/w/index.php?title=DE:Wiki_labels&oldid=748018

So instead of {{Delete}} the initiator thought the users should use {{Template:DE:Delete}} on german pages, which others found not so good idea. Template:Delete got an switch block for the text which uses the page name to determine the correct language (or can be overwritten with an optional lang parameter).

To clarify this approach, another example. This time the Move template:

{{Ambox
|type = proposal
|text = {{#switch: {{lc:{{{lang|{{Langcode}}}}}}}
| de        = Diese Seite sollte nach "'''''{{{1}}}'''''" verschoben werden. Weitere Informationen dazu auf der ([[{{{2|:{{NAMESPACE}} talk:{{PAGENAME}}}}}|Diskussionsseite]])
| #default = It has been proposed that this page be moved to "'''''{{{1}}}'''''". ([[{{{2|:{{NAMESPACE}} talk:{{PAGENAME}}}}}|Discuss]])
}}
|imageright = [[Image:Merge-arrow 2.svg]]
}}

We have a simular problem with many other templates. For example Template:KeyDescription which is used by Taginfo to generate a better view on the documentation. But there is also a Template:De:KeyDescription which isn’t parsed by this tool (see http://taginfo.openstreetmap.org/keys/?key=bridge#wiki http://wiki.openstreetmap.org/wiki/DE:Key:bridge ).
The tool author said that in his view it doesn’t make sense to add support for that at it doesn’t scale to add a new template for every language.

So I would propose that we abandon localized templates in non-template pages.

Why allow localized templates in templates? For bigger pages like Template:Delete the switch construct becomes complex. Other projects like commons move the texts to an own subtemplate which looks quite good.

Base template
/en subpage
/de subpage

I think this also makes sense for the upcoming installation of the translate extension.

Whats your opinion?

Regards,
Andi

PS: Credits for some examples got to Reneman [1]

I think this sounds reasonable from a Bot POV. Using official namespaces beside the template namespace might confuse a lot of bots.

/OT
Even if I like it very much, if people contribute to the wiki internals, I’m not sure, if it’s currently nessary to translate templates. IMHO it’s more important to get our content up to date and translated :confused:

Another advantage is that it sorts out oddly formatted templates such as http://wiki.openstreetmap.org/wiki/Template:DE:RelationDescription.

Today, I bumped into https://wiki.openstreetmap.org/wiki/Template:Place, a Template that supports both mechanisms. Is there any consensus which variant is the preferred one?

I would personally prefer one template with translation included, as there are less pages to maintain. Any other views on that?

I’m not aware of a consensus, and I don’t have any strong preferences myself. For simple templates, a language switch seems best. But the Place template’s source code is sufficiently scary that most wiki users might be reluctant to edit it.

There’s a third option: Using a language switch, but moving the localized strings to sub-templates, as with Template:TranslationOf local user group and others in that category. I even created that one myself, but it does have its share of disadvantages, such as massively increasing the number of templates, and enabling “sneaky” changes to popular templates that might not show up on the watchlists of people who only watch the main template…

I hoped I could get around changing >15 Templates just to align them with my changes in the English version :(.

In this case, it looks to me as if an implementation with Lua could make it more understandable due to less code repetition. On the other hand, Lua templates can not make use of regular templates, so you start reimplementing all templates in Lua (see Template:Relation).

How can we find a consensus? In my eyes, this situation is rather bad for maintenance…