Difference between revisions of "Template:Lang"

From Team Fortress Wiki
Jump to: navigation, search
(Created page with '{{#switch:{{SUBPAGENAME}} | af = {{{af|}}} | ar = {{{ar|}}} | az = {{{az|}}} | bcc = {{{bcc|}}} | bg = {{{bg|}}} | br = {{{br|}}} | ca = {{{ca|}}} | cs = {{{cs|}}} | da = {{{da|}…')
 
Line 58: Line 58:
 
}}<noinclude>
 
}}<noinclude>
 
== Usage ==
 
== Usage ==
 +
The main purpose of this template is to keep translations and template code together in one single template. So when the coding is updated, consistency is kept across all language translations.
 +
 
* Using {{tl|lang}} will switch translations based on the value of <code><nowiki>{{SUBPAGENAME}}</nowiki></code>.
 
* Using {{tl|lang}} will switch translations based on the value of <code><nowiki>{{SUBPAGENAME}}</nowiki></code>.
 +
* To define an English translation, you can use <code><nowiki>{{lang|en=Welcome}}</nowiki></code> or simply <code><nowiki>{{lang|Welcome}}</nowiki></code>.
  
 +
;Example:
 
<pre>
 
<pre>
 
{{Ambox
 
{{Ambox
Line 69: Line 73:
 
</pre>
 
</pre>
  
[[Category:Templates]]
+
[[Category:Templates|Lang]]
[[Category:Language templates]]
+
[[Category:Language templates|Lang]]
 
</noinclude>
 
</noinclude>

Revision as of 23:56, 6 August 2010

Usage

The main purpose of this template is to keep translations and template code together in one single template. So when the coding is updated, consistency is kept across all language translations.

  • Using {{lang}} will switch translations based on the value of {{SUBPAGENAME}}.
  • To define an English translation, you can use {{lang|en=Welcome}} or simply {{lang|Welcome}}.
Example
{{Ambox
| contents = {{ambox/message
  | 1 = {{lang|de=Sprache|ja=言語|pl=Język}}
  | 2 = {{lang|de=Willkommen|ja=Irashaimasu|pl=Witaj}}
  }}
}}