[OSM-talk] Templates in the wiki

Pieren pieren3 at gmail.com
Sun Aug 17 11:16:37 BST 2008


On Sun, Aug 17, 2008 at 3:47 AM, Florian Heer <florianheerfheb at yahoo.de> wrote:
> During that I came across a lot of templates which is all very nice but
> it seems that all of them lack a way to control standard texts and
> internal links via a language argument. Just as an example the template
> "KeyDescription" has the texts "Description" and "Group" hard-coded in
> it. I would love it to read "Beschreibung" resp. "Gruppe".

Instead of making the template {{KeyDescription}} tranlatable with all
texts in variable, you should better create a german template e.g.
De:KeyDescription where the whole template is in german.
Then, when you translate the page "Key:railway", you insert the german
template and not the english template.
So replace:
{{KeyDescription
|key=railway
by:
{{De:KeyDescription
|key=railway  <-- you can even rename the variables in german

> Also the template "Map_Features:highway" has, as much as I understand
> it, no way of changing the key/value-links from the englisch to the
> language-specific.
>
Some of the Map Features template have already the column title
configurable. You can see it. For instnace, the waterway template
heading is:
{| class="wikitable" border="1" cellspacing="0" cellpadding="2" width="100%"
|- style="background-color:#F8F4C2"
! style="width:70px" | {{{head:key|Key}}}
! style="width:100px" | {{{head:value|Value}}}
! style="width:70px" | {{{head:element|Element}}}
! | {{{head:desc|Comment}}}
! style="width:100px" | {{{head:render|Rendering}}}
! style="width:100px" | {{{head:photo|Photo}}}

Then, when you call the template in your german page, you add the
variable definition:
|head:key=Schlüssel
|head:value=Wert
|head:element=Element <-- not necessary if you keep the default english name
|head:photo=Foto
(or the right words in german ;-)

Some of the map features tables already contain these texts as
variable but not all of them. You could complete the missing ones.

This is two different approaches for the templates usage. The
map_features template can be shared by many countries and translated
accordlingly. The strong advantage of this is that the list of map
features is maintained in a single wiki page for all countries. Thus,
if values are added or removed, it is immediately reflected in all
translated pages. The other templates should be in general duplicated
in a country specific language.

Pieren




More information about the talk mailing list