Template:Language/archives/Lang2/doc
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.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
A translation template. Successor to both {{Lang}}
(itself was forked to create {{Lang2}}
) and {{MultiPage}}
, while solving most of the limitations in both templates. Currently the template is largely incomplete and cannot be used in any pages until bugs or issues is fixed. Also this template only support very few languages as it was being rewritten to only support languages that are most popular, and to cleaning up code before adding new languages.
Differences
Usage
For existing pages using {{Lang}}
:
- On the "Half-Life 2" page for example, edit all page, including translated one and replace
{{Lang}}
with{{Lang2}}
. Most previous parameters from{{Lang}}
should work with{{Lang2}}
. - Remove suf-based language suffixes (
|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:You can use Notepad++ (or other software), and replace all (|suf=:de
) with blank text. - Remove the language suffixes on the language categories from all language subpages. For example,
[[Category:Source:ru]]
will become. - Move the translated page (From
Example article:<language code>
to new suffixExample article/<language code>
(for example, Half-Life 2:zh-cn will become an Half-Life 2/zh). Done.
Important:do not switch a page using {{MultiPage}} to this template unless you are a moderator. You will not be able to retain the history of the English page.
- For pages using deprecated
or{{Entity}}
templates, replace it with{{Format}}
{{This is a}}
template.
Todo: Should we bring back separate language categories (which Lang uses) or remove it like MultiPage?
Note:At the moment, Lang2 currently does not support page name beginning with language code as a prefix, yet. Through we might plan to add it if we can.
This will workaround the issues that the search suggestions are showing results from both the base (English) page and the translated page, cluttering the results.
This will workaround the issues that the search suggestions are showing results from both the base (English) page and the translated page, cluttering the results.
Parameters and Examples
Parameter | Description | Example |
---|---|---|
{{{1}}}
|
The page that the template create multi-language links according to. It is required for other translation page. The contents of it should be the full name of the page the template is being applied on, including namespaces such as Help: , Template: , User: , etc. It should not include any language suffixes, however, such as /ru , /es , /zh , etc.
Note:Capitalization matters, even on the first letter of the page name! Underscores must be replaced with spaces.
ai_changehintgroup must be written as Ai changehintgroup . However, this parameter can be omitted if the page name is without a suffix. Confirm:Is this fixed with Lang2? If not, feel free to fix this issues if you can.
Tip:You can use
{{Lang2|{{FULLPAGENAME}}}} instead of writing the article name, unless there are any issues mentioned above. |
|
{{{2}}} ~ {{{8}}}
|
These parameters are used to link subpages (such as L4D2 Level Design/Add-on Notes , L4D Level Design/Panic Events , Half-Life: Alyx Workshop Tools/Animgraph/AnimGraph Introduction , etc.). Just replace "/ " with "| " to link correctly. See the examples for details how to use them.
Note:The subpages must be moved to a correctly name so that the template can link them. Non-English subpage names must follow this format:
<page1><lang code>/<page2><lang code>/... , such as L4D Level Design/Panic Events/zh |
|
{{{title}}}
|
This parameter can be used to change the page title (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 "<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.
|
|
{{{$title}}}
|
This parameter can be used to change the text of the page titlebar and place the title under the <code> tag - {{Lang2|Template:Lang2|$title=$model}}. | |
{{{notitle}}}
|
This parameter can be used to change the title of the site page itself, but not for the title of the article itself. | |
{{{noborder}}}
|
This parameter can be set to 1 to hide the border around lang icons. If you don't plan on using it, don't bother defining it. | |
{{{select}}}
|
The selection mode of the title. 1 is the one-click selection (just like clicking the "1").
|
|
{{{up}}}
|
Todo: Document it.
|
[Todo] |
Currently Supported Languages
- Coming soon.
- Also, this template automatically adds a page language category at the bottom of the page.