Template:Lang links/doc: Difference between revisions
More actions
m upd |
m refactor |
||
| Line 2: | Line 2: | ||
|1=1 | |1=1 | ||
|1d=Page name of the page that's subpages provide the translation | |1d=Page name of the page that's subpages provide the translation | ||
|1def= | |1def=<nowiki>{{NAMESPACE}}:{{BASEPAGENAME}}</nowiki> | ||
|1stat=optional | |1stat=optional | ||
|2=suppressaddlink | |2=suppressaddlink | ||
| Line 9: | Line 9: | ||
|2stat=optional- | |2stat=optional- | ||
|name=Lang links | |name=Lang links | ||
|desc-az=Bu şablon yeni tərcümələri avtomatik əlavə edir. | |||
|desc-de=Zeigt an, welche Sprachversionen einer Übersetzung existieren. | |||
|desc-en=Shows which language versions of a page exist. | |||
|desc-es=Esta plantilla añade automáticamente nuevas traducciones. No debe ser usada para reemplazar páginas /lang creadas manualmente. A veces es bueno tener algunos vínculos en rojo pues esto anima a realizar nuevas traducciones. | |||
|desc-fr=Ce modèle ajoute automatiquement de nouvelles traductions. Il ne devrait cependant pas être utilisé pour remplacer des pages de type /lang créées manuellement. Parfois il peut être intéressant de disposer de quelques liens rouges, car cela encourage à créer de nouvelles traductions. | |||
|desc-ka=ეს თარგი ავტომატურად ამატებს ახალ თარგმანებს. | |||
|desc-ru=Этот шаблон добавляет новые переводы автоматически. | |||
|desc-diq=Na şablon açarnayışanê newe otomatikmene dekena de. | |||
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: | |namespace=Template | ||
|usergroup=All | |||
|placement= | |||
|usage-notes= | |||
This template shows which language versions of a page exist (based on the naming scheme <code>../xx</code>, with <code>xx</code> the language code), and provides links to them. For example: | |||
{{xpdoc|lang links|Template:No source since}} | {{xpdoc|lang links|Template:No source since}} | ||
| Line 30: | Line 32: | ||
which does not distinguish between a postfix for a language and other postfixes such as /doc and /layout. Also it takes more space. Another difference is that the language code is shown, rather than the local name. | which does not distinguish between a postfix for a language and other postfixes such as /doc and /layout. Also it takes more space. 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 <code><nowiki>/lang</nowiki></code> subpage, transclude it to the template and regularly update it using {{tls|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:Ll]] will generate the same results but must be substituted. | ||
| Line 45: | Line 47: | ||
|lines=1 | |lines=1 | ||
|shorthand= | |shorthand= | ||
|relieson=[[Module:Languages]], [[Module:Languages/List]], [[Module:Page]] | |relieson=[[Module:Languages]], [[Module:Languages/List]], [[Module:Page]], [[Module:Link]] | ||
|useTemplateData=1 | |||
}} | }} | ||
Revision as of 17:15, 13 September 2013
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:
{{lang links|Template:No source since}} → English
Compare:
{{Special:PrefixIndex/Template:No source since/}} →
which does not distinguish between a postfix for a language and other postfixes such as /doc and /layout. Also it takes more space. 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
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Page name of the page that's subpages provide the translation | {{NAMESPACE}}:{{BASEPAGENAME}} | optional | |
suppressaddlink | allows to remove the +/- -link | empty | 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.
| |||||||||||||||
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, Module:Link
Localization
This template is not intended to be localized.