Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Lang links/doc: Difference between revisions

Template page
m documenting "addlink"
See also: Fix link to {{Lang links subst}}
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{lua|Module:Lang links}}
{{TemplateBox
{{TemplateBox
|1=1
|1=1
Line 5: Line 6:
|1stat=optional
|1stat=optional


|2=addlink
|2= num_lang
|2d=provide an alternative add-link or whatever you like right after the language links
|2d=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.
|2def=<nowiki>{{edit|{{NAMESPACE}}:{{BASEPAGENAME}}/lang}}</nowiki>
|2def=70
|2stat=optional-
|2stat=optional


|3=suppressaddlink
|3d=allows to remove the <small><code><nowiki>+/-</nowiki></code></small> -link
|3def=
|3stat=optional-
|name=Lang links
|name=Lang links
|desc-az=Bu şablon yeni tərcümələri avtomatik əlavə edir.
|desc-az=Bu şablon yeni tərcümələri avtomatik əlavə edir.
|desc-de=Zeigt an, welche Sprachversionen einer Übersetzung existieren.
|desc-de=Zeigt an, welche Sprachversionen einer Übersetzung existieren.
|desc-en=Shows which language versions of a page exist.
|desc-en=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.
|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-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-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.
Line 35: Line 31:
Compare:
Compare:


{{xpdoc|Special:PrefixIndex/Template:No source since/}}
{{xpdoc|lang links cheap|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.
(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 <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.
'''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 49: Line 43:
|i18n-desc=
|i18n-desc=
|i18n-mediawiki-msg=
|i18n-mediawiki-msg=
|seealso=
|seealso={{tl|lang links subst}}, {{tl|Lle}}, {{tl|lang links cheap}}
|setscats=
|setscats=
|lines=1
|lines=1
|shorthand=
|shorthand=
|relieson=[[Module:Languages]], [[Module:Languages/List]], [[Module:Page]], [[Module:Link]]
|relieson=[[Module:Lang links]]
|useTemplateData=1
|useTemplateData=1
}}
}}<includeonly>
[[Category:Internal link templates]]
</includeonly>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.