模板:Languages

来自人工智能助力教育知识百科
Kangjf讨论 | 贡献2019年9月11日 (三) 15:57的版本 (创建页面,内容为“{{{{FULLPAGENAME}}|multiple=*}} == Template == <onlyinclude><div id="multilang">{{#if: {{#vardefine:ml-cat|{{#if:{{{category|}}}|/{{{category|}}}|{{#var:ml-cat}}}}}…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

Template

Syntax

{{Multi-lang|PageName|Language Code}}
  • PageName (optional) - the name of the page to display language links for. If omitted then the English version of the current page is used. This parameter can normally be omitted, as it is only required if you want to link to a page other than the one you place the template on, which is very uncommon. If this parameter is used on a sub-page make sure you supply the root name, not the full page name (e.g. on MediaWiki/fr you would need to use {{Multi-lang|MediaWiki}} and not {{Multi-lang|MediaWiki/fr}}).

Usage

Place this template on pages that exist in more than one language in the same location on each translation of the page.

The English version of a page is always the main version, with all other languages as sub-pages, named using the appropriate language code (see below).

For example, on the Main Page you would include the text {{Multi-lang}}, both on Main Page itself, and on each of its language sub-pages. The template automatically creates links to any language sub-pages that exist, e.g. Main Page/ja, Main Page/fr, and ignores non-existent languages.

See Project:Languages for further details about translating pages.

Supported languages

The template contains a list of supported languages. Although it is easy to add a new language to the list, do not add unnecessary languages. The language that has no pages in that language should be kept out of the list.

Articles in need of translation

The following link to articles in need of translation. They are in no particular order.

模板:Needs Translation

Versioning

The template offers the possibility to define a version number for an English parent article. If such a value is defined, translated articles need to match the version number. In case they don't match, they're registered to subcategories of Category:Articles in need of updating. For example Category:Articles in need of updating/KB/de or Category:Articles in need of updating/LSL/fr. Additionally, a message box is displayed on top of the article, in order to inform about the needed update. This message box can contain information on the update, to make it easier for translators to find the changes and to sync it with the translated versions.

To define a version number, create a subpage at English_Article_Name/version and add

{{Multi-lang/Version
 |version number
 |title
 |message
 }}

For example:

{{Multi-lang/Version
 |2
 |needs update
 |A new paragraph is added to the English article.
 }}

The version number for translated articles can be set via the version parameter. E.g.:

{{Multi-lang
 |English Article
 |/ISO-639-1-code
 |version=2
 }}

Translated articles can be exempt from the update-prompt by setting them to a negative version number.

Origin

This template is originally taken from Template:Languages on the MediaWiki web site.