Jump to content

Template:Language

From Meta, a Wikimedia project coordination wiki
This template is outdated. Use {{#language:fr|de}} -> Französisch.

This template produces the word for a language given the language code, in a given language. By default, the fall-back language is English. Optionally this is suppressed, and the template produces nothing if the word is not available in the desired language. This can be useful if the English term is given anyway, with another call of the template.

Parameters

Parameter name Description Default value
1 language code for the language name to be produced empty
2 language code for the language in which the name is expressed the result of {{uselang}} , giving en
3 if non-empty: do not produce the English word if the word in the requested language is not available; instead, produce nothing empty

Examples

  • {{language}}
  • {{language|ar}} → Arabic
  • {{language|de}} → German
  • {{language|is}} → Icelandic
  • {{language|nl}} → Dutch
  • {{language|zh-hant}} → Traditional Chinese
  • {{language|ar||x}} → Arabic
  • {{language|de||x}} → German
  • {{language|is||x}} → Icelandic
  • {{language|nl||x}} → Dutch
  • {{language|zh-hant||x}} → Traditional Chinese
  • {{language|ar|de}} → Arabisch
  • {{language|de|de}} → Deutsch
  • {{language|is|de}} → Isländisch
  • {{language|nl|de}} → Niederländisch
  • {{language|zh-hant|de }} → Chinesisch (traditionell)
  • {{language|ar|de|x}} → Arabisch
  • {{language|de|de|x}} → Deutsch
  • {{language|is|de|x}} → Isländisch
  • {{language|nl|de|x}} → Niederländisch
  • {{language|zh-hant|de|x}} → Chinesisch (traditionell)

If the subtemplate for the language in which the name is expressed is known to exist, and fall-back to English if the word is not available is not desired, then the subtemplate can more efficiently be called directly as follows:

  • {{language/nl|ar}} → Arabisch
  • {{language/nl|de}} → Duits
  • {{language/nl|is}}
  • {{language/nl|nl}} → Nederlands
  • {{language/nl|zh-hant}}

Required

  • Template:Language/xx for the language in which the name is expressed, with in that page support for the language name to be produced:

They can be copied from commons (see list), but the following modification is needed:

  • the default is removed

Localization

This template calls Template:Language/en. The following language versions are available:

Other languages:

Each calls Template:Language/layout.

See also

Similar to en:Template:Language and fr:Modèle:Langue-local.