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
No edit summary
See also: Fix link to {{Lang links subst}}
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{lua|Module:Languages}}
{{lua|Module:Lang links}}
{{lua|Module:Lang links}}
{{TemplateBox
{{TemplateBox
Line 9: Line 8:
|2= num_lang
|2= num_lang
|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.
|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=
|2def=70
|2stat=optional
|2stat=optional
|3=addlink
|3d=provide an alternative add-link or whatever you like right after the language links
|3def=<nowiki>{{edit|{{NAMESPACE}}:{{BASEPAGENAME}}/lang}}</nowiki>
|3stat=optional-
|4=suppressaddlink
|4d=allows to remove the <small><code><nowiki>+/-</nowiki></code></small> -link
|4d-td=allows to remove the "<nowiki>+/-</nowiki>" -link
|4def=
|4stat=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. The template first looks for /lang subpage and if found transcludes it, if /lang subpage does not exist it searches thru all supported languages and tests if they exist. At some point in early 2020 number of languages supported by WikiMedia rose above number of expensive calls allowed on the page, causing this template to place all pages using it in [[:Category:Pages with too many expensive parser function calls]], unless they have /lang subpage.
|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 48: Line 36:


'''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 57: Line 43:
|i18n-desc=
|i18n-desc=
|i18n-mediawiki-msg=
|i18n-mediawiki-msg=
|seealso={{tl|Ll}}, {{tl|Lle}}, {{tl|lang links cheap}}
|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]]
|relieson=[[Module:Lang links]]
|useTemplateData=1
|useTemplateData=1
}}<includeonly>
}}<includeonly>
[[Category:Internal link templates]]
[[Category:Internal link templates]]
</includeonly>
</includeonly>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.