Jump to content

Template:Languages/Lang

Permanently protected template
From Meta, a Wikimedia project coordination wiki
Template documentation


Usage

This sub-template doesn't display properly when not included. Please see Template:Languages or Template:Languages light for complete versions.

This template is designed to simplify Template:Languages, by allowing a simpler syntax for adding new languages. Each language is included by calling this template with the following parameters:

  • 1=language-code — e.g. fr.
  • 2=Page name (optional) — if not supplied the page is automatically worked out based on where the language template is included.
  • name=language English name (optional) — a few language codes (or non-recommended aliases still used on Media-Wiki) don't have a name defined by MediaWiki #language: parser function, this provide it for display in tooltips.
  • autonym=language native name (optional) — like name but this is the native language name instead.
  • all=flag (optional) — if set to an empty string, the language will be displayed without testing if its subpage exist (if it does not exist, a red link will appear; this parameter is only needed to test the full lists of languages, in the documentation page of the template transcluding this template). See for example Template:Languages light/doc.

This template should not be used anywhere except in the Languages template.

Warning

This templates uses the costly ParserFunction #ifexist: (only once per usage), in order to avoid displaying a red link for the missing subpage.

If this template is transcluded repeatedly on the same viewed page with long lists of language codes, this may exhaust the current MediaWiki parser limit of 500 calls to costly parser functions.

See also

  • {{Languages/Lang/all}} (similar but without the existence test; the link is always generated)