Difference between revisions of "Template:If lang"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Undo revision 15577 by Cesrate (talk))
m (* examples to pages that exist here)
Line 12: Line 12:
 
! Language page result (de)
 
! Language page result (de)
 
|-
 
|-
| <code><nowiki>[[Soldier{{if lang}}]]</nowiki></code>
+
| <code><nowiki>[[Kerbin{{if lang}}]]</nowiki></code>
| [[Soldier]]
+
| [[Kerbin]]
| [[Soldier/de]]
+
| [[Kerbin/de]]
 
|-
 
|-
| <code><nowiki>[[Soldier {{if lang}}]]</nowiki></code>
+
| <code><nowiki>[[Kerbin {{if lang}}]]</nowiki></code>
| [[Soldier]]
+
| [[Kerbin]]
| [[Soldier /de]]
+
| [[Kerbin /de]]
 
|-
 
|-
 
|}
 
|}
Line 25: Line 25:
 
{{tlx|if lang}} can be used in more advanced ways by specifying the English and non-English outputs.
 
{{tlx|if lang}} can be used in more advanced ways by specifying the English and non-English outputs.
  
* <code><nowiki>{{if lang|non-en=_{{SUBPAGENAME}}}}</nowiki></code> will generate <code>_de</code> when used on [[Equalizer/de]].
+
* <code><nowiki>{{if lang|non-en=_{{SUBPAGENAME}}}}</nowiki></code> will generate <code>_de</code> when used on [[Gilly/de]].
 
** This example is used in [[:Category:Infobox templates|infobox templates]] to display item name images in the correct language.
 
** This example is used in [[:Category:Infobox templates|infobox templates]] to display item name images in the correct language.
  

Revision as of 19:14, 30 May 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}} recognises 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-hans, zh-hant