From translatewiki.net
Jump to navigation Jump to search
Test Template Info-Icon - Version (2).svg
The documentation of this template is included from the Template:Languagename/doc page. [Edit]
Works like {{#language:lang1|lang2}} but supports the transition of legacy codes still used by MediaWiki or still not supported by #language: and #languagename: parser functions in MediaWiki.
| 1=lang1
| 2=lang2
  • 1=lang1 code representing the language name (mandatory)
  • 2=lang2 code of the language into which the language name will be translated (optional)
    The default empty value will return the autonym, as if lang2=lang1; i.e. this template works like the #language: parser function of MediaWiki.
    To display the language name translated in the current user language selected in the UI, pass the value {{UILANGCODE}} (the MediaWiki parser function #languagename: is similar, except that its default value for parameter 2 is the UI language rather than the value of parameter 1, so it does not return the language autonym by default like #language:).
    Note that locale tags from the BCP 47 standard (as well as language codes from the ISO 639 standard from which most of them are inherited) are not case sensitive, but should preferably use dashes (-) as separators between locale subtags rather than underscores (_).
  • ‹{{Languagename|fr}}› generates ‹français› (the language autonym, in its native script and orthography)
  • ‹{{Languagename|fr|fr}}› generates ‹français› (should be the same as the previous)
  • ‹{{Languagename|fr|en}}› generates ‹French› (language name translated to English)
  • ‹{{Languagename|fr|ar}}› generates ‹الفرنسية› (language name translated to Arabic)
  • ‹{{Languagename|fr|{{UILANGCODE}}}}› generates ‹French› (should be the name translated in your own prefered language)
See also:
  • Template:Languagename: main template which normalizes the input language codes, and uses some fallbacks shared across known variants (such as formal or informal variants in Wikimedia sites) of some target languages
  • Template:Languagename/db: subtemplate called internally after normalizing the input language codes, and using some fallbacks shared across known variants of some target languages, containing the actual names
  • Template:Languagecat: derived template to get a base language name in English for the name of base categories per language
  • Template:Scriptname