Template:Language/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{doc/subpage}}
When transcluded or used in namespaces highlighted with orange text this template returns language shortcut based on language prefix of the page otherwise it returns the shortcut based on user's interface language.
When transcluded or used in namespaces highlighted with orange text this template returns language shortcut based on language prefix of the page otherwise it returns the shortcut based on user's interface language.


Line 28: Line 29:
* {{Tl|language}} used or transcluded on page <code>Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation</code> becomes en
* {{Tl|language}} used or transcluded on page <code>Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation</code> becomes en
* {{Tl|language}} used or transcluded on page <code>Ja/Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation</code> becomes ja
* {{Tl|language}} used or transcluded on page <code>Ja/Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation</code> becomes ja
Example use in templates or in namespaces where language is determined by interface language (those '''not''' highlighted with orange):
<pre>{{#switch: {{language}}
    | #default = English
    | ja = 日本語
    | zh-tw = 中文(台灣)
    }}</pre>


== See Also ==
== See Also ==
* {{ParserFunction|switch}}
* {{T|LanguageBar}}
* {{T|LanguageBar}}
* [[Project:Alternative Languages]]
* [[Project:Alternative Languages]]

Latest revision as of 13:49, 4 April 2025

Edit-copy.png
This is a documentation subpage for Template:Language.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

When transcluded or used in namespaces highlighted with orange text this template returns language shortcut based on language prefix of the page otherwise it returns the shortcut based on user's interface language.

Templates Template:pagelang or Template:intlang are substituted in the subpages which are named after each namespace number


Language prefix:

  • {{language}} used or transcluded on page Hu/Info_target becomes hu
  • {{language}} used or transcluded on page Category:Vi/Level Design becomes vi
  • {{language}} used or transcluded on page Help:Eo/Contents becomes eo
  • {{language}} used or transcluded on page Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation becomes en
  • {{language}} used or transcluded on page Ja/Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation becomes ja


Example use in templates or in namespaces where language is determined by interface language (those not highlighted with orange):

{{#switch: {{language}}
    | #default = English
    | ja = 日本語
    | zh-tw = 中文(台灣)
    }}

See Also