テンプレート:Language

2015年3月14日 (土) 12:15時点におけるNijcadmin (トーク | 投稿記録)による版 (1版)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
This template is outdated. Use {{#language:fr|de}} -> français.

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

Some results depend on the user language, try: deenfrnl

  • {{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

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:

Required

  • The page MediaWiki:Lang/xx for the user language xx set in the preferences; it should contain the language code xx
  • Lang/ja
  • 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: English | 日本語 | +/− Each calls Template:Language/layout.

See also

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