Template:LangSwitch: Difference between revisions

Jump to navigation Jump to search
+Copyable sample; -List of two-letter language codes. They are now all included in the copyable sample
m (Commenting the template source)
(+Copyable sample; -List of two-letter language codes. They are now all included in the copyable sample)
Line 17: Line 17:


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


Line 25: Line 24:
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.
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.


  <nowiki>{{</nowiki>'''LangSwitch''' <nowiki>|</nowiki>''de='' <nowiki>|</nowiki>''en='' <nowiki>|</nowiki>''es='' <nowiki>|</nowiki>''fr='' <nowiki>|</nowiki>''nl='' <nowiki>|</nowiki>''ru='' ... <nowiki>|</nowiki>''lang=''<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''LangSwitch''' <nowiki>|</nowiki>''de='' <nowiki>|</nowiki>en= <nowiki>|</nowiki>''es='' <nowiki>|</nowiki>''fr='' <nowiki>|</nowiki>''nl='' <nowiki>|</nowiki>''ru='' ... <nowiki>|</nowiki>''lang=''<nowiki>}}</nowiki>


  <nowiki>{{</nowiki>'''LangSwitch'''
  <nowiki>{{</nowiki>'''LangSwitch'''
  <nowiki>|</nowiki> ''de'' =  
  <nowiki>|</nowiki> ''de'' =  
  <nowiki>|</nowiki> ''en'' =  
  <nowiki>|</nowiki> en =  
  <nowiki>|</nowiki> ''es'' =  
  <nowiki>|</nowiki> ''es'' =  
  <nowiki>|</nowiki> ''fr'' =  
  <nowiki>|</nowiki> ''fr'' =  
Line 38: Line 37:
  <nowiki>}}</nowiki>
  <nowiki>}}</nowiki>


== Examples ==
=== Translating templates ===
=== Translating templates ===
The template is mainly used for translating templates.
The template is mainly used for translating templates.
Line 76: Line 76:
}}
}}


== Copyable sample ==
Please uncomment used entries, in essence by dragging and dropping <code>&lt;!--</code> to the left of the name of the language.
<nowiki>{{LangSwitch
<!-- | ca =  Catalan -->
<!-- | de =  German-->
| en =  <!-- English-->


 
<!-- | es =  Spanish -->
=== Examples of language codes ===
<!-- | fa Farsi -->
{{{!}} class="wikitable"
<!-- | fi Finnish -->
! ISO 639-1
<!-- | fr French -->
two letter code
<!-- | it =  Italian -->
! English name of language
<!-- | nl Dutch -->
{{!-}}
<!-- | pl Polish -->
{{!}} ca {{!!}} Catalan
<!-- | pt Portugese -->
{{!-}}
<!-- | ru Russian -->
{{!}} de {{!!}} German
<!-- | sv Swedish -->
{{!-}}
<!-- | zh =  Chinese -->
{{!}} en {{!!}} English
| lang = {{{lang}}}
{{!-}}
}}</nowiki>
{{!}} es {{!!}} Spanish
{{!-}}
{{!}} fa {{!!}} Farsi
{{!-}}
{{!}} fi {{!!}} Finnish
{{!-}}
{{!}} fr {{!!}} French
{{!-}}
{{!}} nl {{!!}} Dutch
{{!-}}
{{!}} pl {{!!}} Polish
{{!-}}
{{!}} pt {{!!}} Portugese
{{!-}}
{{!}} ru {{!!}} Russian
{{!-}}
{{!}} sv {{!!}} Swedish
{{!-}}
{{!}} zh {{!!}} Chinese
{{!}}}


== Known issues ==
== Known issues ==

Navigation menu