Template:Languagename

From translatewiki.net
Jump to navigation Jump to search

Test Template Info-Icon - Version (2).svg

The documentation of this template is included from its /doc subpage (Edit)

Usage:
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.
Syntax:
{{Languagename
| 1=lang1
| 2=lang2
}}
Parameters:
  • 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 (_).
Examples:
  • ‹{{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 ‹English› (should be the name translated in your own prefered language)
See also: