Template:Language/archives/MultiPage/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 2: Line 2:
Replacement for {{tl|Lang}}.
Replacement for {{tl|Lang}}.


{{ModernWarning|Before using, read the [[/instruction|instructions]] for moving pages. At the moment it is not very well done, but there are the main points in it.}}
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 ( [[File:Icon-translate.png|12px|link=]] ) in the upper right corner and select the primary language. After making a choice, {{tl|MultiPage}} will redirect you to edit the language subpage on which you will need to place your text and template {{tl|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 {{ModernImportant}} Do not move associated talk page;
# Move the contents of the translated My Cute Article page to its language subpage My Cute Article/<[[#SupportedLanguages|language code]]> (for example, My Cute Article:zh-ch will become an My Cute Article/zh);
# Move the English categories to the base page (for example, to the My Cute Article page);
# Move the shared or international templates to the base page;
# Remove language suffixes ({{Code|:pt-br}}, {{Code|{{!}}suf{{=}}:de}}). 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.
 
After the above steps, place {{tl|MultiPage}} on the base page above the categories and enjoy what you see.
 
{{ModernNote|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>}}.}}


== Parameters and Examples ==
== Parameters and Examples ==
Line 10: Line 28:
!Example
!Example
|-
|-
|align="center"|No Parameters
| align="center" | No Parameters
|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.
| Places a template.
|{{CodeBlock|{{((}}{{ROOTPAGENAME}}{{))}}}}
|{{CodeBlock|{{((}}{{ROOTPAGENAME}}{{))}}}}
|-
|-
|align="center"|{{Code|style=1|{{param|page}}}}
| align="center" | {{Code|style=1|{{param|page}}}}
|''Optional:'' The page that the template create multi-language links according to.  
| ''Optional:'' The page that the template create multi-language links according to.  
{{ModernNote|Capitalization matters, even on the first letter of the page name! Underscores must be replaced with spaces. {{Code|select=1|ai_changehintgroup}} must be written as {{Code|select=1|Ai changehintgroup}}. However, this parameter can be omitted if the page name is without a suffix.}}
{{ModernNote|Capitalization matters, even on the first letter of the page name! Underscores must be replaced with spaces. {{Code|select=1|ai_changehintgroup}} must be written as {{Code|select=1|Ai changehintgroup}}. However, this parameter can be omitted if the page name is without a suffix.}}
|{{CodeBlock|<nowiki>{{MultiPage|page=Main Page}}</nowiki>}}
| {{CodeBlock|<nowiki>{{MultiPage|page=Main Page}}</nowiki>}}
|-
|-
|align="center"|{{Code|style=1|{{param|basepage}}}}
| align="center" | {{Code|style=1|{{param|basepage}}}}
|''Optional:'' If the translations are in subpages that are level 2 or above, this can specify what the root page name is.
| ''Optional:'' If the translations are in subpages that are level 2 or above, this can specify what the root page name is.
{{ModernNote|Capitalization matters, even on the first letter of the page name! Underscores must be replaced with spaces. {{Code|select=1|ai_changehintgroup}} must be written as {{Code|select=1|Ai changehintgroup}}. However, this parameter can be omitted if the page name is without a suffix.}}
{{ModernNote|Capitalization matters, even on the first letter of the page name! Underscores must be replaced with spaces. {{Code|select=1|ai_changehintgroup}} must be written as {{Code|select=1|Ai changehintgroup}}. However, this parameter can be omitted if the page name is without a suffix.}}
|{{CodeBlock|<nowiki>{{MultiPage|page=Template:Doc/doc|basepage=Template:Doc}}</nowiki>}}
|{{CodeBlock|<nowiki>{{MultiPage|page=Template:Doc/doc|basepage=Template:Doc}}</nowiki>}}
|-
|-
|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).  
{{ModernWarning|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.}}
{{ModernWarning|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.}}
{{ModernNote|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
{{ModernNote|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
Line 31: Line 49:
| {{CodeBlock|<nowiki>{{MultiPage|title=Main Page}}</nowiki>}}
| {{CodeBlock|<nowiki>{{MultiPage|title=Main Page}}</nowiki>}}
|-
|-
|align="center"|{{Code|style=1|{{param|margin-right}}}}
| align="center" | {{Code|style=1|{{param|margin-right}}}}
|''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>}}
|}
|}
== Examples ==
== Examples ==
{{CodeBlock|{{((}}MultiPage{{))}}}}
{{CodeBlock|{{((}}MultiPage{{))}}}}
Line 42: Line 61:


== Other ==
== Other ==
{| class="standard-table sortable" style="width:100%"
{| class="standard-table sortable" id="SupportedLanguages" style="width:100%"
|+ Currently Supported Languages
|+ Currently Supported Languages
! Language
! Language
Line 101: Line 120:
| Hebrew ||Page_name/he ||{{he}} ||{{tl|he}}
| Hebrew ||Page_name/he ||{{he}} ||{{tl|he}}
|}
|}
== See Also ==
* {{tl2|Language subpage}}


{{Doc/Sandbox other|[[Category:Translation templates]]}}
{{Doc/Sandbox other|[[Category:Translation templates]]}}

Revision as of 17:04, 5 April 2023

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.

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;
  2. 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-ch will become an My Cute Article/zh);
  3. Move the English categories to the base page (for example, to the My Cute Article page);
  4. Move the shared or international templates to the base page;
  5. Remove language suffixes (:pt-br, |suf=:de). They are deprecated and no longer needed.
  6. Remove language categories (for example, [[Category:My Cute Category:ru]]) from all language subpages. They are deprecated and no longer needed.
  7. Place {{Language subpage}} at the top of the language subpages.

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

Template:ModernNote

Parameters and Examples

Parameter Description Example
No Parameters Places a template.
{{Language}}
{{{page}}} Optional: The page that the template create multi-language links according to.

Template:ModernNote

{{MultiPage|page=Main Page}}
{{{basepage}}} Optional: If the translations are in subpages that are level 2 or above, this can specify what the root page name is.

Template:ModernNote

{{MultiPage|page=Template:Doc/doc|basepage=Template:Doc}}
{{{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).

Template:ModernWarning Template:ModernNote

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

Examples

{{MultiPage}}

Template:ModernNote

Other

Currently Supported Languages
Language Page name Icon Icon Template
English Page_name/en
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|en}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{en}}
Catalan Page_name/ca
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|ca}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{ca}}
Czech Page_name/cs Template:Cz {{cz}}
German Page_name/de
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|de}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{de}}
Spanish Page_name/es
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|es}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{es}}
Esperanto Page_name/eo
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|eo}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{eo}}
Estonian Page_name/et
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|et}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{et}}
French Page_name/fr
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|fr}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{fr}}
Hungarian Page_name/hu
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|hu}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{hu}}
Greek Page_name/el
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|el}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{el}}
Italian Page_name/it
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|it}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{it}}
Dutch Page_name/nl
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|nl}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{nl}}
Norwegian Page_name/no
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|no}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{norway}}
Polish Page_name/pl
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|pl}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{pl}}
Portuguese Page_name/pt
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|pt}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{pt}}
Portuguese (Brazilian) Page_name/pt-br
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|pt-br}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{pt-br}}
Russian Page_name/ru
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|ru}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{ru}}
Ukrainian Page_name/uk
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|uk}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{uk}}
Swedish Page_name/sv
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|sv}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{sv}}
Turkish Page_name/tr
{{tr}}
Japanese Page_name/ja Template:Ja {{ja}}
Chinese (PRC) Page_name/zh
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{zh}}
Chinese (Taiwan) Page_name/zh-tw
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh-tw}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{zh-tw}}
Korean Page_name/ko
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|ko}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{ko}}
Georgian Page_name/ka
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|ka}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{ka}}
Hebrew Page_name/he
Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|he}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
||{{he}}