Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G


From FlightGear wiki
Revision as of 19:31, 17 April 2019 by Johan G (Talk | contribs) (Known issues: Hmm. The template assumes that there is text for the language given by the lang parameter. It was only meant for debugging and demonstration purposes when written.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following template description is not displayed when the template is inserted in an article.


This template will show texts in different languages depending on the language of the page it is placed on.

It is mainly meant for translation of contents within templates so that a single template can be used in pages of different languages, rather than having to be translated with one template for each language.

The language the text will be shown in depends on the two letter language code between the page namespace and the page title, for example Talk:De/HB Radio-NAV. If a parameter with a text is not available in the language of the page or is empty, the English text will be shown instead provided it is available.


The parameters of this template corresponds to the ISO 639-1 two letter language code for the language to be used in that parameter.

For testing and demonstration purposes the named parameter lang can be used to select a different language than the language of the page the template is used on.

{{LangSwitch |de= |en= |es= |fr= |nl= |ru= ... |lang=}}
| de = 
| en = 
| es = 
| fr = 
| nl = 
| ru = 
| lang = 


Translating templates

The template is mainly used for translating templates.

Note Many templates are based on tables and thus have to start from the beginning of the line. That is accomplished by putting them on a new line like in the example below.

Note Inserting blank lines will alter the way the template is rendered.

| en =  <!-- English -->
{{ Template with English contents }}
| de =  <!-- German -->
{{ Template with German contents }}
| fr =  <!-- French -->
{{ Template with French contents }}

Using the lang parameter

For testing and demonstration purposes the the lang parameter can be used to override the automatic language selection.

<!-- Caveat: Google translated -->
| de = Hallo Welt!
| en = Hello World!
| es = ¡Hola Mundo!
| fr = Bonjour tout le monde!
| nl = Hello World!
| ru = Привет мир!
| lang = fr

Bonjour tout le monde!

Copyable sample

Please uncomment used entries, in essence by dragging and dropping <!-- to the left of the name of the language, like as with English in the example below.

<!-- | ca =  Catalan -->
<!-- | de =  German -->
| en =  <!-- English -->
<!-- English/default text here -->
<!-- | es =  Spanish -->
<!-- | fa =  Persian -->
<!-- | fi =  Finnish -->
<!-- | fr =  French -->
<!-- | it =  Italian -->
<!-- | ja =  Japanese -->
<!-- | nl =  Dutch -->
<!-- | pl =  Polish -->
<!-- | pt =  Portugese -->
<!-- | ru =  Russian -->
<!-- | sl =  Slovenian -->
<!-- | sr =  Serbian -->
<!-- | sv =  Swedish -->
<!-- | zh =  Chinese -->
| lang = {{{lang|}}}

Known issues

Using some characters like equal signs (=) and pipes/vertical strokes (|) inside template parameters will break the template. Do note that pipes will break tables and that this workaround have to be used for tables. Ways around this is to either use {{=}}, {{!}}, {{!!}} or {{!-}}, or <nowiki>=</nowiki>, <nowiki>|</nowiki>, <nowiki>||</nowiki> or <nowiki>|-</nowiki>.

The template currently does not check if there is text in the language used by the lang override parameter.

Related content