Template:MultiPage

From Valve Developer Community
(Redirected from Template:Multipage)
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 would 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:
{{ulf|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.
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}}). Similarly, the language toolbar will also be slightly off when users visit the redirected page. 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}}.

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

Usage on existing pages

Before using it on an existing page, 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}}, much 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 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.
{{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).
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.

Other

Currently Supported Languages
Language Page name Icon
English Page_name/en English (en)
Catalan Page_name/ca català (ca)
Croatian Page_name/hr hrvatski (hr)
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)
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)