Template:MultiPage

From Valve Developer Community
Jump to: navigation, search
Warning.pngWarning:Do not use this template on template pages! We are working towards having universal templates for all languages, meaning that we no longer need "<template name>:<lang code>", and we can just use an automatically translated template. Using this translation method will undermine all the work we have been putting in for months now. Instead, use {{Autolang}} for translations, and for previewing languages on template pages, uses "{{Uselangflags}}" with noinclude. This will allow for automatically changing the language used in the template while not creating 8 different pages for one template.
Icon-Bug.pngBug:Causes some pages, such as List of Team Fortress 2 console commands and variables to not render because of too many templates included.
PlacementTip.pngWorkaround: Copy/Paste the following instead of {{MultiPage}} on the affected pages:
{{uselangflags|en=1|<other languages used>|multipageworkaround=1}} {{:{{FULLPAGENAME}}/{{uselang}}}}

This will allow the page to display properly and give the illusion of visual parity with other MultiPage pages. Make sure to visit {{Uselangflags}} for documentation about this template.

This SHOULD NOT be used unless absolutely necessary! This is only a temporary fix until we find a way to fix this issue!

Blank image.pngTodo: remove forced line break before page contents when text comes before this template.
Blank image.pngTodo: stop Category:English from being added to the base page via transclusion whenever an english subpage exists. This issue only happens for english.
Curly brackets white.pngTemplate Documentation
Icon-translate.png
View
Edit
Page history
Icon-translate.png
This template uses a strings subpage
Please follow the format on this subpage(s) to add translations.
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}}). This is a limitations in MediaWiki software itself.
Blank image.pngTodo: Add a {{Error}} message to warn editors who have previously added MultiPage, but forgot to remove {{Lang}}.

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}}.

Usage on existing pages

Before using it on an existing page, you should make sure that you have done the following steps:

  1. 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.
  1. Move the contents 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);
  2. Move the English categories to the base (main) page, aka the one with {{MultiPage}} (for example, to the My Cute Article page);
  3. Move the shared or international templates to the base page;
  4. 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.
  5. Remove language categories (for example, [[Category:My Cute Category:ru]]) from all language subpages. They are deprecated and no longer needed.
  6. Place {{Language subpage}} at the top of the language subpages.
  7. If the article pertains to an entity, move the {{Entity}} template to the root page. The Entity template is automatically translated.

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.

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}} 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.
{{MultiPage}}
{{{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).
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.
{{MultiPage|title=Main Page}}
{{{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.

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)
French Page_name/fr Français (fr)
Hebrew Page_name/he עברית (he)
Hindi Page_name/hi हिन्दी (hi)
Hungarian Page_name/hu Magyar (hu)
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)
Chinese (PRC) Page_name/zh 中文 (zh)
Chinese (Taiwan) Page_name/zh-tw 中文(台灣)‎ (zh-tw)