Difference between revisions of "Template:If lang"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (+zh-tw;)
Line 1: Line 1:
 
{{#switch:{{#if:{{{from|}}}|{{{from}}}|{{SUBPAGENAME}}}}
 
{{#switch:{{#if:{{{from|}}}|{{{from}}}|{{SUBPAGENAME}}}}
| ar|cs|da|de|es|fi|fr|hu|it|ja|ko|nl|no|pl|pt|pt-br|ro|ru|sv|tr|zh-cn|zh-hans|zh-hant = {{{2|{{{non-en|{{{lang|/{{SUBPAGENAME}}}}}}}}}}}
+
| ar|cs|da|de|es|fi|fr|hu|it|ja|ko|nl|no|pl|pt|pt-br|ro|ru|sv|tr|zh-cn|zh-tw = {{{2|{{{non-en|{{{lang|/{{SUBPAGENAME}}}}}}}}}}}
 
| #default = {{{1|{{{en|}}}}}}
 
| #default = {{{1|{{{en|}}}}}}
 
}}<noinclude>{{doc start}}
 
}}<noinclude>{{doc start}}
Line 32: Line 32:
 
{| class="wikitable grid" style="margin: 1em 0;"
 
{| class="wikitable grid" style="margin: 1em 0;"
 
! Available languages
 
! Available languages
| ar, cs, da, de, es, fi, fr, hu, it, ja, ko, nl, no, pl, pt, pt-br, ro, ru, sv, tr, zh-cn, zh-hans, zh-hant
+
| ar, cs, da, de, es, fi, fr, hu, it, ja, ko, nl, no, pl, pt, pt-br, ro, ru, sv, tr, zh-cn, zh-tw
 
|}  
 
|}  
  

Revision as of 10:19, 9 June 2013

Documentation for If lang

{{if lang}} is a template that can output specified values based on whether a particular page is a language subpage or not.

Usage

Code English page result Language page result (de)
[[Kerbin{{if lang}}]] Kerbin Kerbin/de
[[Kerbin {{if lang}}]] Kerbin Kerbin /de

Advanced

{{if lang}} can be used in more advanced ways by specifying the English and non-English outputs.

  • {{if lang|non-en=_{{SUBPAGENAME}}}} will generate _de when used on Gilly/de.
    • This example is used in infobox templates to display item name images in the correct language.

Languages supported

{{if lang}} recognizes only the below language subpages (the same as {{lang}}):

Available languages ar, cs, da, de, es, fi, fr, hu, it, ja, ko, nl, no, pl, pt, pt-br, ro, ru, sv, tr, zh-cn, zh-tw