Template:Language info: Difference between revisions

From Terraria Wiki
Jump to navigation Jump to search
No edit summary
m (+{{i18n-ready}})
(One intermediate revision by the same user not shown)
Line 7: Line 7:
-->{{translation projects}}<!-- $displaytitle is not set
-->{{translation projects}}<!-- $displaytitle is not set
-->}}<!-- (this differentiation is needed because "|displaytitle=<blank>" would override the default in {{translation projects}})
-->}}<!-- (this differentiation is needed because "|displaytitle=<blank>" would override the default in {{translation projects}})
-->|<!--
-->{{common}}<!-- {{language info}} is supposed to be on every page, so do the "common" process here.
-->}}<!--
-->}}<!--
-->{{common}}<!-- {{language info}} is supposed to be on every page, so do the "common" process here.


// offwiki languages must (and only need to) define en page name: {{language info|en=<en page name>}}
// offwiki languages must (and only need to) define en page name: {{language info|en=<en page name>}}
Line 19: Line 18:
-->{{#if:{{#var:_en}}|<!--
-->{{#if:{{#var:_en}}|<!--
-->{{#ifeq:{{#var:_en}}|{{#titleparts:{{FULLPAGENAME}}}}||<!-- if not eq
-->{{#ifeq:{{#var:_en}}|{{#titleparts:{{FULLPAGENAME}}}}||<!-- if not eq
-->[[category:English language info not matched]]<!--
-->[[Category:English language info not matched]]<!--
-->}}<!--
-->}}<!--
-->|<!--
-->|<!--
Line 31: Line 30:
//non-English language interwiki links
//non-English language interwiki links
-->{{#invoke:language_info|interwiki_links|en={{#var:_en|{{#titleparts:{{FULLPAGENAME}}}}}}|lang={{lang}}}}<!--
-->{{#invoke:language_info|interwiki_links|en={{#var:_en|{{#titleparts:{{FULLPAGENAME}}}}}}|lang={{lang}}}}<!--
--></includeonly><noinclude>{{lua}}{{doc}}{{language info|en=Template:Language info}}</noinclude>
--></includeonly><noinclude>{{lua}}{{i18n-ready}}{{doc}}{{language info|en=Template:Language info}}</noinclude>

Revision as of 17:54, 24 June 2022

This template uses Lua.
This template uses Module:Language info, a script written in the Lua programming language. To learn more about Lua, see Terraria Wiki:Lua.
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Language info/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Language info/doc. (edit | history)

This template displays interwiki links, helps organizing the translation projects, and performs some additional miscellaneous operations.

It should be placed at the end of every non-redirect page in the following namespaces:

The template calls {{translation projects}} and {{common}}. It is furthermore the core part of the automatic interwiki link system of the Terraria Wiki: It collects the page names and English interwiki links from each language wiki, merges them to form a database on the English wiki, and then displays the interwiki links according to the language wiki and page it is used on.

Usage

{{ language info | en = <English page name> }}

en

Name of the English page. On the English wiki, this must be identical to the page name, so it can be set to {{subst:FULLPAGENAME}}. On language wikis (both on-wiki[1] and off-wiki[2]), it should be the name of the English version of the page.

Interwiki link database maintenance

The automatic interwiki link system relies on the database Module:Language info/data. It is based on all the {{language info}} calls on all the different wikis. This database needs to be updated periodically; the most recent version is always at Template:Language info/datagen. (Because this template transcludes several templates with very long outputs, it might fail to load. In this case, inspect the source code of the template and assemble its output manually.) Once updated, all the interwiki links on the English wiki and the on-wiki languages[1] will be up-to-date.

The off-wiki languages[2] also require the database Module:Language info/data. It can simply be synced as-is from the English wiki.

Footnotes