This template is protected from editing.

Difference between revisions of "Template:Lang name"

From Team Fortress Wiki
Jump to: navigation, search
m (Native names: fail)
m (Add missing languages that are supported by the main language template)
 
(9 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
| #default = {{#switch:{{lc:{{{2|{{{lang|}}}}}}}}
 
| #default = {{#switch:{{lc:{{{2|{{{lang|}}}}}}}}
 
   | ar = Arabic
 
   | ar = Arabic
 +
  | bg = Bulgarian
 
   | cs = Czech
 
   | cs = Czech
 
   | da = Danish
 
   | da = Danish
 
   | de = German
 
   | de = German
 +
  | en = English
 
   | es = Spanish
 
   | es = Spanish
 +
  | es-419 = Spanish (Latin America)
 
   | fi = Finnish
 
   | fi = Finnish
 
   | fr = French
 
   | fr = French
Line 21: Line 24:
 
   | ru = Russian
 
   | ru = Russian
 
   | sv = Swedish
 
   | sv = Swedish
 +
  | th = Thai
 +
  | tr = Turkish
 +
  | uk = Ukrainian
 +
  | vi = Vietnamese
 
   | zh-hans = Chinese (Simplified)
 
   | zh-hans = Chinese (Simplified)
 
   | zh-hant = Chinese (Traditional)
 
   | zh-hant = Chinese (Traditional)
Line 30: Line 37:
 
   | Danish    = da
 
   | Danish    = da
 
   | German    = de
 
   | German    = de
 +
  | English    = en
 +
  | Spanish Spain
 +
  | Spanish (Spain)
 
   | Spanish    = es
 
   | Spanish    = es
 +
  | Spanish Latin America
 +
  | Spanish (Latin America) = es-419
 
   | Finnish    = fi
 
   | Finnish    = fi
 
   | French    = fr
 
   | French    = fr
Line 47: Line 59:
 
   | Russian    = ru
 
   | Russian    = ru
 
   | Swedish    = sv
 
   | Swedish    = sv
 +
  | Thai      = th
 +
  | Turkish    = tr
 +
  | Ukrainian  = uk
 +
  | Vietnamese = vi
 
   | S.Chinese
 
   | S.Chinese
 
   | Chinese Simp
 
   | Chinese Simp
Line 62: Line 78:
 
| native = {{#language:{{{2|{{{type|}}}}}}}}
 
| native = {{#language:{{{2|{{{type|}}}}}}}}
  
}}</includeonly><noinclude>{{doc begin}}
+
}}</includeonly><noinclude>
{{tl|Lang name}} can output the ISO code for a language if given the English name, or the English name if given the ISO code.  
+
{{doc begin}}
 +
{{tl|Lang name}} can output the ISO code for a language if given the English name, or the English name if given the ISO code.
  
== Usage ==
+
=== Usage ===
 
The first parameter should contain what type of output you want, and the second should contain the language code or name.
 
The first parameter should contain what type of output you want, and the second should contain the language code or name.
  
Line 93: Line 110:
 
** Brazilian Portuguese
 
** Brazilian Portuguese
 
** Portuguese (Brazil)
 
** Portuguese (Brazil)
 +
* "es"
 +
** Spanish Spain
 +
** Spanish (Spain)
 +
** Spanish
 +
* "es-419"
 +
** Spanish Latin America
 +
** Spanish (Latin America)
  
 
=== Native names ===
 
=== Native names ===
 
The MediaWiki software can already display the native name of a language by using the code {{code|1=<nowiki>{{#language:de}}</nowiki>}} (which generates "{{#language:de}}"). However, {{tl|Lang name}} can also perform the same function using the syntax {{tlx|Lang name|native|de}}.
 
The MediaWiki software can already display the native name of a language by using the code {{code|1=<nowiki>{{#language:de}}</nowiki>}} (which generates "{{#language:de}}"). However, {{tl|Lang name}} can also perform the same function using the syntax {{tlx|Lang name|native|de}}.
  
 +
[[Category:Interface templates|Lang name]]
 
[[Category:Language templates|Lang name]]
 
[[Category:Language templates|Lang name]]
 
</noinclude>
 
</noinclude>

Latest revision as of 22:38, 15 December 2021

Documentation for Lang name

{{Lang name}} can output the ISO code for a language if given the English name, or the English name if given the ISO code.

Usage

The first parameter should contain what type of output you want, and the second should contain the language code or name.

Extra options

Any of the following options can be used to specify Chinese and Portuguese languages. Using any of the names from the list will output the language code (shown below in brackets) if type=code or code in parameter 1 is specified.

  • "zh-hans"
    • S.Chinese
    • Chinese Simp
    • Chinese Simplified
    • Chinese (Simplified)
    • Simplified Chinese
    • Simp Chinese
    • Simp. Chinese
  • "zh-hant"
    • T.Chinese
    • Traditional Chinese
    • Chinese Traditional
    • Chinese (Traditional)
  • "pt-br"
    • Portuguese Brazil
    • Brazilian Portuguese
    • Portuguese (Brazil)
  • "es"
    • Spanish Spain
    • Spanish (Spain)
    • Spanish
  • "es-419"
    • Spanish Latin America
    • Spanish (Latin America)

Native names

The MediaWiki software can already display the native name of a language by using the code {{#language:de}} (which generates "Deutsch"). However, {{Lang name}} can also perform the same function using the syntax {{Lang name|native|de}}.