Template:Language/archives/MultiPage/doc

From Valve Developer Community
Jump to: navigation, search
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(台灣)‎ (zh-tw)
Edit-copy.png
This is a documentation subpage for Template:Language.
Don't forget to purge the contents of the base page upon creating or editing this subpage.  
Warning.pngWarning:Editors, please read this! If you have moved a {{lang}} page other than English, you must remove the old language category page (anything ends with Category:(Page Name):es or Category:(Page Name):(language code) for example).
Furthermore, if you also moving the English {{Lang}} page aswell, you must move the category back to the main ({{MultiPage}}) page to avoid showing the language subpage on category.
Icon-Bug.pngBug:If the user changes the font size (other than 16px) on the web browser, the language toolbar will get overlapped with topicons (e.g. {{HLATools topicons}}). Similarly, the language toolbar will also be slightly off when users visit the redirected page. This is a limitations in MediaWiki software itself.  [todo tested in?]
Todo: Add a {{Error}} message to warn editors who have previously added MultiPage, but forgot to remove {{Lang}}.

A translation template. Replacement for {{Lang}}.

The template will look for translation subpages and load one of them according to the interface language. The template will load the English version and display a message if the translation subpage does not exist. The template will only display a message if there are not any translations and the English version does not exist.

Creating a new page

Just create an empty page, put a {{MultiPage}} on it, click on the translation button ( Icon-translate.png ) in the upper right corner and select the primary language. After making a choice, {{MultiPage}} will redirect you to edit the language subpage on which you will need to place your text and template {{Language subpage}} (placed on top).

Usage on existing pages

Before using it on an existing page, or attempt to replace {{Lang}} with {{MultiPage}}, you should make sure that you have done the following steps:

  1. On the "My Cute Article" page, edit the page and replace {{Lang}} with {{Language subpage}} or {{Langsp}} (shortcut for {{Language subpage}}, which is faster to type). Do the same for the other translated page.
  2. Remove language suffixes (:pt-br, |suf=:de) from all language subpages, and if the template support Autolang, remove it from all templates as well. They are deprecated and no longer needed.
    Tip.pngTip:You can use Notepad++ Notepad++ (or other software), and replace all (:pt-br, |suf=:de) with blank text.
  3. Remove language categories (for example, [[Category:My Cute Category:ru]]) from all language subpages. They are deprecated and no longer needed.
  4. Move the English content of the My Cute Article page to its language subpage My Cute Article/en
    Icon-Important.pngImportant:Do not move associated talk page, however if there are talk pages on any languages other than English, you can move them.
  5. Move the page of the translated My Cute Article page to its language subpage My Cute Article/<language code> (for example, My Cute Article:zh-cn will become an My Cute Article/zh);
  6. Move English categories (without any language suffixes) to the base (main) page, aka the one with {{MultiPage}} (for example, to the My Cute Article page);
  7. Move the shared or international templates to the base page;
If the article pertains to an entity, move the {{This is a}} template to the root page. The template is automatically translated. For {{Entity}} or {{Format}} templates, replace it with {{This is a}} template.

After the above steps, place {{MultiPage}} on the base page above the categories and enjoy what you see.

Note.pngNote:It is also recommended to clean and improve the code of the pages. For example, you could replace all {{note}} with {{Note}}, and add the tab spacing with some line breaks.
Icon-Important.pngImportant:Do not categorize the language subpages, and if they have any categories, remove them.


Using the parameter {{{no-en-subpage}}}

This parameter allows you to keep the English content on the main page, instead of moving the English content to the subpages. This is useful for pages that are move protected by wiki administrators.

Creating a new page

Just create a new page as normal, write down your content (in English). Then place the template before your content, and place {{MultiPage/end}} - a sub-template of {{MultiPage}} at the end of the content. Don't contain categories. For example:

{{MultiPage|no-en-subpage=1}} Example text. {{MultiPage/end}} [[Category:English]] [[Category:Level Design]]

For creating pages for other languages, just click on the translation button ( Icon-translate.png ) in the upper right corner and select the language you want to translate. The content from English page will shows up, then you can start translating them. If nothing shows up, you may need to copy the content on the English page manually.

Usage on existing pages

Similar to the previous, but with differences:

  • On main page (in English), place {{MultiPage}} before the content, and place {{MultiPage/end}} at the end of the content (See the example above). Don't move the English content to its language subpage (/en).
  • The methods of other languages remain unchanged.

Parameters and Examples

Parameter Description Example
No Parameters Places a template.
{{Language}}
{{{title}}} Optional: This parameter can be used to change the text of the page titlebar (logically, into the text that should be displayed for the language of the page).
Note.pngNote:if %short is specified, the long page title (e.g. Source/Docs) will be shortened to the current subpage (i.e. Docs)
Note.pngNote:if a page has a translation and you want to specify the correct page title for that translation, specify the language suffix in {{{title}}} (for example, | title:zh = SDK的安装). To see all available language suffixes, see #Other.
Warning.pngWarning:On some pages you may receive this error: Warning: Display title "env_cubemap" overrides earlier display title "<code>Env cubemap</code>". This can be due to the fact that the page uses a different template in which the page title is set. For example, {{shortpagetitle}}.
{{MultiPage | title = Main Page }}
{{MultiPage | title = %short }}
{{MultiPage | title = Level Design | title:es = Diseño de mapa }}
{{{margin-right}}} Optional: The right margin of the buttons that are to the right top.
{{MultiPage|title = Main Page|margin-right=26px}}
{{{no-en-subpage}}} Optional: If you don't move the original English page to the subpage /en, and this will allow you stay the original content on the main page. Specify it as 1 to take effect.
Note.pngNote:The template must be placed before the content, or it cannot be worked. You must place the template {{MultiPage/end}} at the end of the content. See also example.
{{MultiPage|no-en-subpage=1}} {{Lorem}} {{MultiPage/end}}

Examples

{{MultiPage}}
Note.pngNote:If you want to change the title, use the parameter {{{title}}} of {{Language subpage}} in language subpages so that the title will change automatically. Otherwise, you can
{{MultiPage|title = My sweet page}}
for non-translatable title.

Approximate translations of each language

Only subpages (/en ...) and articles that are in the Languages category.

English (en)

4,296 out of 12,292, 34.95% translated.

Português do Brasil (pt-br)

113 out of 12,292, 0.92% translated.

中文 (zh)

711 out of 12,292, 5.78% translated.

Hrvatski (hr)

76 out of 12,292, 0.62% translated.

Čeština (cs)

2 out of 12,292, 0.02% translated.

Nederlands (nl)

4 out of 12,292, 0.03% translated.

Esperanto (eo)

23 out of 12,292, 0.19% translated.

Eesti (et)

1 out of 12,292, 0.01% translated.

Suomi (fi)

12 out of 12,292, 0.1% translated.

Français (fr)

150 out of 12,292, 1.22% translated.

ქართული (ka)

2 out of 12,292, 0.02% translated.

Deutsch (de)

277 out of 12,292, 2.25% translated.

Ελληνικά (el)

0 out of 12,292, 0% translated.

עברית (he)

3 out of 12,292, 0.02% translated.

Magyar (hu)

18 out of 12,292, 0.15% translated.

Italiano (it)

14 out of 12,292, 0.11% translated.

日本語 (ja)

89 out of 12,292, 0.72% translated.

한국어 (ko)

122 out of 12,292, 0.99% translated.

Norsk (no)

1 out of 12,292, 0.01% translated.

Polski (pl)

70 out of 12,292, 0.57% translated.

Português (pt)

13 out of 12,292, 0.11% translated.

Русский (ru)

972 out of 12,292, 7.91% translated.

Español (es)

216 out of 12,292, 1.76% translated.

Svenska (sv)

4 out of 12,292, 0.03% translated.

中文(台灣)‎ (zh-tw)

27 out of 12,292, 0.22% translated.

Türkçe (tr)

16 out of 12,292, 0.13% translated.

Українська (uk)

37 out of 12,292, 0.3% translated.

Tiếng Việt (vi)

35 out of 12,292, 0.28% translated.

Other

Currently Supported Languages
Language Page name Icon
English Page_name/en English (en)
Catalan Page_name/ca Català (ca)
Czech Page_name/cs Čeština (cs)
German Page_name/de Deutsch (de)
Greek Page_name/el Ελληνικά (el)
Esperanto Page_name/eo Esperanto (eo)
Spanish Page_name/es Español (es)
Estonian Page_name/et Eesti (et)
Finnish Page_name/fi Suomi (fi)
French Page_name/fr Français (fr)
Hebrew Page_name/he עברית (he)
Hindi Page_name/hi हिन्दी (hi)
Hungarian Page_name/hu Magyar (hu)
Croatian Page_name/hr Hrvatski (hr)
Italian Page_name/it Italiano (it)
Japanese Page_name/ja 日本語 (ja)
Georgian Page_name/ka ქართული (ka)
Khmer Page_name/km ភាសាខ្មែរ (km)
Korean Page_name/ko 한국어 (ko)
Malay Page_name/ms Bahasa Melayu (ms)
Dutch Page_name/nl Nederlands (nl)
Norwegian Page_name/no Norsk (no)
Polish Page_name/pl Polski (pl)
Portuguese Page_name/pt Português (pt)
Portuguese (Brazilian) Page_name/pt-br Português do Brasil (pt-br)
Russian Page_name/ru Русский (ru)
Swedish Page_name/sv Svenska (sv)
Turkish Page_name/tr Türkçe (tr)
Ukrainian Page_name/uk Українська (uk)
Vietnamese Page_name/vi Tiếng Việt (vi)
Simplified Chinese (PRC) Page_name/zh 中文 (zh)
Traditional Chinese (Taiwan) Page_name/zh-tw 中文(台灣)‎ (zh-tw)