Help:Templates: Difference between revisions

Jump to navigation Jump to search
→‎Translating templates: Clarification; one more example; Template:Note; Some rephrasing
(→‎Translating templates: Clarification; one more example; Template:Note; Some rephrasing)
Line 177: Line 177:


== Translating templates ==
== Translating templates ==
Translating templates is different from translating normal articles.  All translations are written within one and the same template.  To do that one can use the {{tl|LangSwitch}} template.
Templates are translated in a different way than [[Help:Translate|normal articles]]Instead of creating another page for each translation, all translations are written within one template.  To do that one can use the {{tl|LangSwitch}} template, for example like below.
 
<nowiki>[http://{{LangSwitch
| en =  <!-- English -->
en
| de =  <!-- German -->
de
| fr =  <!-- French -->
fr
}}.wikipedia.org Wikipedia]</nowiki>


  <nowiki>{{LangSwitch
  <nowiki>{{LangSwitch
Line 188: Line 197:
}}</nowiki>
}}</nowiki>


Do note that many templates are based on tables and have to start from the beginning of the line, which is accomplished like in the above example, and that inserting blank lines will alter the way the template is rendered.
{{note|Many templates use tables and have to start from the beginning of the line, like in the above example.}}
{{note|Inserting blank lines or spaces will usually cause unintended changes to the way the template are rendered.}}


The {{tl|LangSwitch}} template uses the two letter language code present in all but the English page titles.  If none of the languages that have been translated to is found, a template have not yet been translated to that language and the English text will be used instead, provided it is available.
The {{tl|LangSwitch}} template uses the two letter language code present in all but the English page titles.  If none of the languages that have been translated to is found, a template have not yet been translated to that language and the English text will be used instead, provided it is available.

Navigation menu