Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Language/doc: Difference between revisions

Template page
+note about {{language}}
link to documentation of {{#language}}
Line 3: Line 3:
This template will return the name of a language given the language code. This template is made specifically for the language codes used in MediaWiki (not necessarily ISO codes, but see {{tl|Language/ISO 639/en}}).
This template will return the name of a language given the language code. This template is made specifically for the language codes used in MediaWiki (not necessarily ISO codes, but see {{tl|Language/ISO 639/en}}).


This template is being migrated to core function <nowiki>{{#language}}</nowiki>.  The [[:Category:Page using language code unsupported by language parser]] is populated by this template.
This template is being migrated to core function <nowiki>{{#language}}</nowiki> documented at [[mw:Help:Magic_words#Miscellaneous]].  The [[:Category:Page using language code unsupported by language parser]] is populated by this template.


==Examples==
==Examples==

Revision as of 01:02, 26 November 2011

This template will return the name of a language given the language code. This template is made specifically for the language codes used in MediaWiki (not necessarily ISO codes, but see {{Language/ISO 639/en}}).

This template is being migrated to core function {{#language}} documented at mw:Help:Magic_words#Miscellaneous. The Category:Page using language code unsupported by language parser is populated by this template.

Examples

The second parameter can be used to set the desired output language, otherwise it will return the name in the user's interface language (if a translation exists).

  • {{language|ar}} → Arabic
  • {{language|ar|de}} → Arabisch
  • {{language|ar|en}} → Arabic
  • {{language|ar|fr}} → arabe
  • {{language|ar|he}} → ערבית
  • {{language|ar|zh-hans}} → 阿拉伯语
  • {{language|en}} → English
  • {{language|en|de}} → Englisch
  • {{language|en|en}} → English
  • {{language|en|fr}} → anglais
  • {{language|en|he}} → אנגלית
  • {{language|en|zh-hans}} → 英语
  • {{language|is}} → Icelandic
  • {{language|is|de}} → Isländisch
  • {{language|is|en}} → Icelandic
  • {{language|is|fr}} → islandais
  • {{language|is|he}} → איסלנדית
  • {{language|is|zh-hans}} → 冰岛语
  • {{language|zh-hant}} → Traditional Chinese
  • {{language|zh-hant|de}} → Chinesisch (traditionell)
  • {{language|zh-hant|en}} → Traditional Chinese
  • {{language|zh-hant|fr}} → chinois traditionnel
  • {{language|zh-hant|he}} → סינית מסורתית
  • {{language|zh-hant|zh-hans}} → 繁体中文

You can also use this template's subpages directly to achieve the same effect (which is also easier on the servers, but you need to know the UI language code to use as the fallback for the target translation, as the syntax above uses the second parameter to determine the fallback applicable to it, in order to generate the subpage names). Given that the current UI language code is {{int:Lang}}=en, the examples above are then equivalent to:

Note that with this syntax, the use of the {{Fallback}} template is avoided in most cases because we know that templates do exist for all target languages specified in parameter 2 (de, en, fr, he, zh-hans), and that these templates contain a translation for all the languages specified in parameter 1 (ar, en, is, zh-hant). This is not necessarily true for all UI languages needed by users (notably for some rare UI languages, or newly added languages), for which a fallback translation to another language must be looked for.

Subpages

See also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.