Template:Lang links/doc
Shows which language versions of a page exist. The template first looks for /lang subpage and if found transcludes it, if /lang subpage does not exist it searches thru chosen number of most used languages and tests if they exist. Displaying languages for templates without /lang is expensive and might land the page in Category:Pages with too many expensive parser function calls, it also might miss subpages for rarely used languages. Create /lang subpage to avoid this issue.
Usage
{{Lang links |1= |num_lang= }}
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:
{{lang links|Template:No source since}}
→
Compare:
{{lang links cheap|Template:No source since}}
→ (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.
Template:Ll will generate the same results but must be substituted.
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
1 | Page name of the page that's subpages provide the translation | {{NAMESPACE}}:{{BASEPAGENAME}} | optional | |
num_lang | Maximum number of languages to test. In order to prevent page using the template from landing in Category:Pages with too many expensive parser function calls or showing Lua errors one can only search through top 20, 50, 70, 100, etc. languages. in 2024 a language ranking study analyzed subpages of 2400 templates and counted language subtemplates for each language. Than about 120 languages were ranked based on number of subpages. This option allows you to only test for most likely languages. | 70 | optional |
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Shows which language versions of a page exist. The template first looks for /lang subpage and if found transcludes it, if /lang subpage does not exist it searches thru chosen number of most used languages and tests if they exist. Displaying languages for templates without /lang is expensive and might land the page in [[:Category:Pages with too many expensive parser function calls]], it also might miss subpages for rarely used languages. Create /lang subpage to avoid this issue.
|
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:Lang links
See also
Localization
This template is not intended to be localized.