This template is protected from editing.
Difference between revisions of "Template:If lang"
(better documentation) |
|||
Line 1: | Line 1: | ||
− | {{# | + | {{#switch:{{SUBPAGENAME}} |
− | {{tl|if lang}} | + | | ar|cs|da|de|es|fi|fr|hu|it|ja|ko|nl|no|pl|pt|pt-br|ro|ru|sv|zh-hans|zh-hant = {{{2|{{{non-en|{{{lang|/{{SUBPAGENAME}}}}}}}}}}} |
+ | | blank | ||
+ | | none | ||
+ | | en | ||
+ | | {{ns:0}} | ||
+ | | {{BASEPAGENAME}} | ||
+ | | #default = {{{1|{{{en|}}}}}} | ||
+ | }}<noinclude>{{doc begin}} | ||
+ | {{tl|if lang}} is a template that can output specified values based on whether a particular page is a language subpage or not. | ||
− | + | == Usage == | |
+ | {| class="wikitable grid" width="60%" | ||
+ | |- | ||
+ | ! Code | ||
+ | ! English page result | ||
+ | ! Language page result (de) | ||
+ | |- | ||
+ | | {{code|[[Soldier<nowiki>{{if lang}}</nowiki>]]}} | ||
+ | | [[Soldier]] | ||
+ | | [[Soldier/de]] | ||
+ | |- | ||
+ | | {{code|[[Soldier <nowiki>{{if lang}}</nowiki>]]}} | ||
+ | | [[Soldier]] | ||
+ | | [[Soldier_/de]] | ||
+ | |- | ||
+ | |} | ||
− | == | + | === Advanced === |
− | + | {{tl|if lang}} can be used in more advanced ways by specifying the English and non-English outputs. | |
− | * | + | * {{code|1=<nowiki>{{if lang | non-en = _{{SUBPAGENAME}} }}</nowiki>}} will generate {{code|_de}} when used on [[Equalizer/de]]. |
− | + | ** This example is used in [[:Category:Infobox templates|infobox templates]] to display item name images in the correct language. | |
− | == | + | == Languages supported == |
− | + | {{tl|if lang}} recognises only the below language subpages (the same as {{tl|lang}}): | |
− | + | {| class="wikitable grid" style="margin: 1em 0;" | |
+ | ! Available languages | ||
+ | | ar, cs, da, de, es, fi, fr, hu, it, ja, ko, nl, no, pl, pt, pt-br, ro, ru, sv, zh-hans, zh-hant | ||
+ | |} | ||
[[Category:Language templates|If lang]] | [[Category:Language templates|If lang]] | ||
</noinclude> | </noinclude> |
Revision as of 09:44, 11 September 2010
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) |
---|---|---|
[[Soldier{{if lang}}]]
|
Soldier | Soldier/de |
[[Soldier {{if lang}}]]
|
Soldier | Soldier_/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 Equalizer/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, zh-hans, zh-hant |
---|