Template:Language/archives/MultiPage/doc: Difference between revisions
No edit summary |
1416006136 (talk | contribs) (new descriptions for new parameter - {{{no-en-subpage}}}) |
||
Line 1: | Line 1: | ||
{{Doc/subpage}} | {{Doc/subpage}} | ||
{{ | {{Warning|Editors, please read this! If you have moved a {{tl|link=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).<br>Furthermore, if you also moving the English {{tl|Lang}} page aswell, you must move the category back to the main ({{tl|link=MultiPage}}) page to avoid showing the language subpage on category.}} | ||
{{ | {{Bug|If the user changes the font size (other than 16px) on the web browser, the language toolbar will get overlapped with topicons (e.g. {{tl|link=HLATools topicons}}). This is a limitations in MediaWiki software itself.}} | ||
{{ | {{Todo|Add a {{tl|link=Error}} message to warn editors who have previously added MultiPage, but forgot to remove {{tl|link=Lang}}.}} | ||
Replacement for {{tl|Lang}}. | Replacement for {{tl|Lang}}. | ||
Line 21: | Line 21: | ||
# Move the English categories to the base (main) page, aka the one with {{Code|<nowiki>{{MultiPage}}</nowiki>}} (for example, to the My Cute Article page); | # Move the English categories to the base (main) page, aka the one with {{Code|<nowiki>{{MultiPage}}</nowiki>}} (for example, to the My Cute Article page); | ||
# Move the shared or international templates to the base page; | # Move the shared or international templates to the base page; | ||
# Remove language suffixes ({{Code|:pt-br}}, {{Code|{{!}}suf{{=}}:de}}) from all language subpages. They are deprecated and no longer needed. | # Remove language suffixes ({{Code|<nowiki>:pt-br</nowiki>}}, {{Code|{{!}}suf{{=}}<nowiki>:</nowiki>de}}) from all language subpages. They are deprecated and no longer needed. | ||
# Remove language categories (for example, {{Code|<nowiki>[[Category:My Cute Category:ru]]</nowiki>}}) from all language subpages. They are deprecated and no longer needed. | # Remove language categories (for example, {{Code|<nowiki>[[Category:My Cute Category:ru]]</nowiki>}}) from all language subpages. They are deprecated and no longer needed. | ||
# Place {{tl|Language subpage}} at the top of the language subpages. | # Place {{tl|Language subpage}} at the top of the language subpages. | ||
Line 28: | Line 28: | ||
After the above steps, place {{tl|MultiPage}} on the base page above the categories and enjoy what you see. | After the above steps, place {{tl|MultiPage}} on the base page above the categories and enjoy what you see. | ||
{{ | {{Note|It is also recommended to clean and improve the code of the pages. For example, you could replace all {{Code|<nowiki>{{note}}</nowiki>}} with {{Code|<nowiki>{{Note}}</nowiki>}}, and add the tab spacing with some line breaks.}} | ||
{{ModernImportant|Do not categorize the language subpages, and if they have any categories, remove them.}} | {{ModernImportant|Do not categorize the language subpages, and if they have any categories, remove them.}} | ||
Line 46: | Line 46: | ||
| align="center" | {{Code|style=1|{{param|title}}}} | | align="center" | {{Code|style=1|{{param|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). | | ''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|On some pages you may receive this error: '''Warning''': Display title "env_cubemap" overrides earlier display title <nowiki>"<code>Env cubemap</code>"</nowiki>. This can be due to the fact that the page uses a different template in which the page title is set.}} | ||
| {{CodeBlock|<nowiki>{{MultiPage|title=Main Page}}</nowiki>}} | | {{CodeBlock|<nowiki>{{MultiPage|title=Main Page}}</nowiki>}} | ||
|- | |- | ||
Line 52: | Line 52: | ||
| ''Optional:'' The right margin of the buttons that are to the right top. | | ''Optional:'' The right margin of the buttons that are to the right top. | ||
| {{CodeBlock|<nowiki>{{MultiPage|title=Main Page|margin-right=26px}}</nowiki>}} | | {{CodeBlock|<nowiki>{{MultiPage|title=Main Page|margin-right=26px}}</nowiki>}} | ||
|- | |||
| align="center" | {{Code|style=1|{{param|no-en-subpage}}}} | |||
| ''Optional:'' If you don't move the original English page to the subpage {{Code|/en}}, and this will allow you stay the original content on the main page. Specify it as {{Code|1}} to take effect. {{Note|The template must be placed before the content, or it cannot be worked. You must place the template {{tl2|MultiPage/end}} at the end of the content. See also example.}} | |||
| {{CodeBlock|<nowiki>{{MultiPage|no-en-subpage=1}} | |||
{{Lorem}} | |||
{{MultiPage/end}}</nowiki>}} | |||
|} | |} | ||
Line 57: | Line 63: | ||
{{CodeBlock|{{((}}MultiPage{{))}}}} | {{CodeBlock|{{((}}MultiPage{{))}}}} | ||
{{ | {{Note|If you want to change the title, use the parameter {{Code|style=1|{{param|title}}}} of {{tl|Language subpage}} in language subpages so that the title will change automatically. Otherwise, you can | ||
{{CodeBlock|{{((}}MultiPage{{!}}title {{=}} My sweet page{{))}}}} for non-translatable title.}} | {{CodeBlock|{{((}}MultiPage{{!}}title {{=}} My sweet page{{))}}}} for non-translatable title.}} | ||
Revision as of 05:08, 21 August 2023

Don't forget to purge the contents of the base page upon creating or editing this subpage.

{{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.
{{HLATools topicons}}
). This is a limitations in MediaWiki software itself. [todo tested in ?]{{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 ( ) 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:
- Move the English content of the My Cute Article page to its language subpage My Cute Article/en
Important:Do not move associated talk page, however if there are talk pages on any languages other than English, you can move them.
- 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);
- Move the English categories to the base (main) page, aka the one with {{MultiPage}} (for example, to the My Cute Article page);
- Move the shared or international templates to the base page;
- Remove language suffixes (:pt-br, |suf=:de) from all language subpages. They are deprecated and no longer needed.
- Remove language categories (for example, [[Category:My Cute Category:ru]]) from all language subpages. They are deprecated and no longer needed.
- Place
{{Language subpage}}
at the top of the language subpages. - 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.


Parameters and Examples
Parameter | Description | Example |
---|---|---|
No Parameters | Places a template. | |
{{{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).
![]() |
|
{{{margin-right}}} | Optional: The right margin of the buttons that are to the right top. | |
{{{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. ![]() |
Examples

{{Language subpage}}
in language subpages so that the title will change automatically. Otherwise, you can
for non-translatable title.Other
Language | Page name | Icon |
---|---|---|
English | Page_name/en | ![]() |
Catalan | Page_name/ca | ![]() |
Czech | Page_name/cs | ![]() |
German | Page_name/de | ![]() |
Greek | Page_name/el | ![]() |
Esperanto | Page_name/eo | ![]() |
Spanish | Page_name/es | ![]() |
Estonian | Page_name/et | ![]() |
French | Page_name/fr | ![]() |
Hebrew | Page_name/he | ![]() |
Hindi | Page_name/hi | ![]() |
Hungarian | Page_name/hu | ![]() |
Italian | Page_name/it | ![]() |
Japanese | Page_name/ja | ![]() |
Georgian | Page_name/ka | ![]() |
Khmer | Page_name/km | ![]() |
Korean | Page_name/ko | ![]() |
Malay | Page_name/ms | ![]() |
Dutch | Page_name/nl | ![]() |
Norwegian | Page_name/no | ![]() |
Polish | Page_name/pl | ![]() |
Portuguese | Page_name/pt | ![]() |
Portuguese (Brazilian) | Page_name/pt-br | ![]() |
Russian | Page_name/ru | ![]() |
Swedish | Page_name/sv | ![]() |
Turkish | Page_name/tr | ![]() |
Ukrainian | Page_name/uk | ![]() |
Vietnamese | Page_name/vi | ![]() |
Chinese (PRC) | Page_name/zh | ![]() |
Chinese (Taiwan) | Page_name/zh-tw | ![]() |