Template:Lang links/doc

From "PTTLink Wiki"
Jump to navigation Jump to search

Shows which language versions of a page exist.

Usage

{{Lang links |1= }}

This template shows which language versions of a page exist (based on the naming scheme ../xx, with xx the language code), and provides links to them. For example:

Template:Xpdoc

Compare:

Template:Xpdoc

(based on Special:Prefixindex), which does not distinguish between a postfix for a language and other postfixes such as /doc and /layout. Another difference is that the language code is shown, rather than the local name.

This template should not be used on templates to avoid hitting the "expensive parser function" or the "LUA execution time" limit on pages with other expensive templates. If your template needs language links, create a /lang subpage, transclude it to the template and regularly update it using {{subst:lle}}. Never use this template directly or indirectly on templates intended for the file namespace that will likely stay there for a long time.

Performance: This template makes use of different approaches to be fast and correct. First, it evaluates all subpages of the page it show the language links for. If this takes too long, it switches to another approach: It checks, for each language, whether a page in that language exists. Therefore: If can avoid that your page gets a lot of subpages, this template's performance will be superior. Technical details and talk at Template talk:Lang links#Using LUA.

Template:Ll will generate the same results but must be substituted.

Template parameters

ParameterDescriptionDefaultStatus
1Page name of the page that's subpages provide the translation{{NAMESPACE}}:{{BASEPAGENAME}}optional
addlinkprovide an alternative add-link or whatever you like right after the language links{{edit|{{NAMESPACE}}:{{BASEPAGENAME}}/lang}}optional
suppressaddlinkallows to remove the +/- -linkemptyoptional

Shows which language versions of a page exist.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
1

Page name of the page that's subpages provide the translation

Default
{{NAMESPACE}}:{{BASEPAGENAME}}
Unknownoptional
addlink

provide an alternative add-link or whatever you like right after the language links

Default
{{edit|{{NAMESPACE}}:{{BASEPAGENAME}}/lang}}
Unknownoptional
suppressaddlink

allows to remove the "+/-" -link

Unknownoptional

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Relies on:
Module:Languages, Module:Languages/List, Module:Page

⧼Seealso⧽

{{Ll}}, {{Lle}}, {{lang links cheap}}

Localization

This template is not intended to be localized.