You are not logged in.

#1 2013-04-01 11:40:09

saerdnaer
Member
Registered: 2011-12-04
Posts: 38

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.p … did=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]

Last edited by saerdnaer (2013-04-01 11:47:34)

Offline

#2 2013-04-01 14:36:38

!i!
Member
Registered: 2009-11-28
Posts: 3,311
Website

Re: Localized templates

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 hmm

Last edited by !i! (2013-04-01 14:37:36)


privater Account von KVLA-HRO-Mei

Offline

#3 2013-04-03 17:26:45

Wynndale
Member
Registered: 2009-04-26
Posts: 38

Re: Localized templates

Another advantage is that it sorts out oddly formatted templates such as http://wiki.openstreetmap.org/wiki/Temp … escription.

Offline

#4 2018-11-15 19:48:57

Tigerfell
Member
Registered: 2018-09-01
Posts: 90

Re: Localized templates

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?

Offline

#5 2018-11-15 20:54:35

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,686
Website

Re: Localized templates

Tigerfell wrote:

Is there any consensus which variant is the preferred one?

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...


OSM in 3D: OSM2World

Offline

#6 2018-11-17 01:05:04

Tigerfell
Member
Registered: 2018-09-01
Posts: 90

Re: Localized templates

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

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...

Offline

Board footer

Powered by FluxBB