Difference between revisions of "Template:If lang"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Languages supported: +documented that th is supported;)
m (*replace 'Parameter Row' and 'ParameterRow' by 'Parameter row';)
Line 26: Line 26:
  
 
{{Parameter Table|name=both|parameters=
 
{{Parameter Table|name=both|parameters=
{{Parameter Row|1|name2=en|If the language code isn't recognized returns this parameter.|Not set}}
+
{{Parameter row|1|name2=en|If the language code isn't recognized returns this parameter.|Not set}}
{{Parameter Row|2|name2=non-en|name3=lang|If the language code is recognized returns this parameter.|{{{prefix}}} and the language code}}
+
{{Parameter row|2|name2=non-en|name3=lang|If the language code is recognized returns this parameter.|{{{prefix}}} and the language code}}
{{Parameter Row|3|name2=data|If the suffix is recognized as a data suffix returns this parameter.|{{{prefix}}} and the data suffix}}
+
{{Parameter row|3|name2=data|If the suffix is recognized as a data suffix returns this parameter.|{{{prefix}}} and the data suffix}}
{{Parameter Row|prefix|The prefix before the language code.|<tt>/</tt>}}
+
{{Parameter row|prefix|The prefix before the language code.|<tt>/</tt>}}
{{Parameter Row|data enabled|If set enables the data suffix detection.|Not set/Disabled}}
+
{{Parameter row|data enabled|If set enables the data suffix detection.|Not set/Disabled}}
 
}}
 
}}
  

Revision as of 20:49, 26 November 2014

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.

Template:Parameter Table

Languages supported

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

Available languages ar, cs, da, de, es, fi, fr, he, hr, hu, it, ja, ko, nl, no, pl, pt, pt-br, ro, ru, sv, th, tr, zh-cn, zh-tw
Available data suffixes Data, Box, RefFrame