Template:If lang: Difference between revisions

From the Portal Wiki
Jump to navigation Jump to search
*>Seb26
(Update to use {{dictionary}} system.)
 
(Created page with "{{#switch:{{SUBPAGENAME}} | 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}}}}}}}}}}} | {{BASEPAGENAME}} | #d...")
Line 13: Line 13:
! Language page result (de)
! Language page result (de)
|-
|-
| {{code|[[Soldier<nowiki>{{if lang}}</nowiki>]]}}
| {{code|[[Portals<nowiki>{{if lang}}</nowiki>]]}}
| [[Soldier]]
| [[Portals]]
| [[Soldier/de]]
| [[Portals/de]]
|-
|-
| {{code|[[Soldier <nowiki>{{if lang}}</nowiki>]]}}
| {{code|[[Portals <nowiki>{{if lang}}</nowiki>]]}}
| [[Soldier]]
| [[Portals]]
| [[Soldier_/de]]
| [[Portals_/de]]
|-
|-
|}
|}
Line 26: Line 26:
{{tl|if lang}} can be used in more advanced ways by specifying the English and non-English outputs.
{{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}}&nbsp;}}</nowiki>}} will generate {{code|_de}} when used on [[Equalizer/de]].
* {{code|1=<nowiki>{{if lang | non-en = _{{SUBPAGENAME}}&nbsp;}}</nowiki>}} will generate {{code|_de}} when used on [[Portals/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:58, 21 April 2011

The template above may be partially or fully invisible or glitched due to the respected strings aren't entered.
This is normal.

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)
[[Portals{{if lang}}]] Portals Portals/de
[[Portals {{if lang}}]] Portals Portals_/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 Portals/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