Help:Multi-language Conventions

From Xen
Icon Info.png Also see Category:Languages!

The Languages Template

Pages and categories which exist in multiple translations must have the {{Languages}} template at the bottom of the page. This allows user to see the translations that are available for that page.

If you use multiple languages, the {{Languages}} template must be on every page in that language.

The English page contains:

<!-- The content of the actual page is here. -->
<!-- The {{Languages}} template must be at the bottom of the page! -->
<!-- There should be NO empty lines after {{Languages}}  -->
{{Languages}}

The translated page contains:

<!-- The content of the actual page is here. -->
<!-- The {{Languages}} template must be at the bottom of the page! -->
<!-- There should be NO empty lines after {{Languages}}  -->
{{Languages|<name of English page>|<language code>}}

For example [[Main Page/pt]] contains

{{Languages|Main Page|pt}}

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

Naming conventions for translated pages

Translated pages need to follow the following naming conventions.

<My Page Name>/<2 Letter Language Code>

The two letter language code must be one of the codes shown in the supported languages table, for example

Page Name Language
Main Page English
Main Page/de German
Main Page/es Spanish
Main Page/fr French
Main Page/ja Japanese
Main Page/ko Korean
Main Page/pt Portuguese
Main Page/pt-br Brazilian Portuguese
Main Page/zh Chinese

Examples

Examples of valid page names are:

[[Category:Xen/ja]]
[[Frontend_Driver/de]]
[[Archived/XCI Getting Started/pt]]
[[Template:Fmbox/doc/zh]]

Languages Category

Translated pages must be Categorized: they must contain a category of the form

[[Category:Languages/<Language code>]]

such that it is possible to find all pages of a specific language.

Examples

Examples of valid category names are:

[[Category:Languages/ja]]
[[Category:Languages/pt]]

Links for translated pages

You have to be careful when linking to other pages. Say you want to link to

[[DomU_Install_with_Virt-Manager]]

If you use the page above, you will go to the English page. If you want to go to a translated page, the link must look as follows

[[DomU_Install_with_Virt-Manager/<language code>]]

E.g.

[[DomU_Install_with_Virt-Manager/es]]

If you keep links to English documents in a translation, it is a good idea to use the following convention

[[DomU_Install_with_Virt-Manager]] (English)

such that people see, that the document is in English.

Examples & Testing

Example Page

Note that it is important to follow the conventions as outlined here. If not followed, the language templates do not work properly and users will find it hard to find translated content.

Page Foo must contain

{{Languages}}

Page Foo/es must contain

{{Languages|Foo|es}}

The following notation also works, but is harder to use

[[Category:Languages/es]]
{{Languages|Foo}}

Example Category

Page Category:Foo must contain

{{Languages}}

Page Category:Foo/es must contain

{{Languages|:Category:Foo|es}}

Testing whether you have done OK

You should be able to see the following:

  • A box called 'Languages on the English and translated page (see bottom of Main Page as an example)
  • A box called 'Languages on the English and translated category
  • The 'Languages box should show: English, The Language You added, languages somebody else added. If it doesn't, you probably used the wrong language macro on the English page.
  • Translated pages should be in the Language/<your language> category, e.g. Language/es. You should go to the category for your language and check whether all pages are in this category.

Language Policy

Languages

This page describes the current multi-lingual policy on wiki.xen.org.


The main page

The English version of our front page is located at Main Page. Translated versions are located at MediaWiki/code, where code is the language code (e.g. Main Page/fr).

Importantly, the rules about language codes (see below) should be followed here as well.

Other namespaces

Apart from the Main Page, no policy has yet been decided about other namespaces. For the time being, if you would like to create translations for pages in other namespaces then please do so as described for the Help: namespace, however content may be moved or deleted depending on the policy that is eventually adopted.

Note that the rule that English content should not be placed in sub-pages does not apply to other namespaces. This is one of the issues that needs resolving.

Language codes

Throughout wiki.xen.org you should use the language codes specified by the MediaWiki software when creating language-specific content (see Names.php for the full and up-to-date list).

Please also bear the following in mind:

  • If the language code is not found in Names.php then we should not host pages in that language.
  • If MediaWiki uses the 'incorrect' code for a language then you should also (for consistency) use that incorrect code here. If you think a code is incorrect you should discuss it on MediaWiki Bugzilla, and if this results in it being changed we will move the pages to match.
  • Note that some language codes in Names.php are now deprecated (e.g. zh-yue has been replaced with yue). In these cases only the most recent code should be used.
Languages Language: English  • français • português do Brasil