Template:Language/archives/Lang2/doc

From Valve Developer Community
Jump to navigation Jump to search
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
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.  

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

Features {{Lang}} {{Lang2}} (this template) {{MultiPage}} {{Page}}
Language subpage location English: None (base page)
Other languages: Page_name{{:}}Lang
English: None (base page)
Other languages: Page_name/Lang (this may be changed to the future into Lang/Page_name which would solve the search clutter issue).
All, including English are located in Page_name/Lang.
The base page itself just contains {{MultiPage}}.
Rely on {{String}} or {{Autolang}}, meant that all other languages are hidden in the base page.
Requires purge? Base page only, in order to display the language
icons if the translated page (except English) was recently created. Does not require purging base (English) page for subsequent edits to translated page.
Also like Lang2, in the drop down menu, "red" links will not turn "blue" until the page is purged to reload the template.
Same as Lang. Except that, in the drop down select language menu, "red" links will not turn "blue" automatically,
but clicking on it will lead to an existing page if it was created recently. User can optionally purge to turn the "red" links to "blue".
Required No
Category translation support Yes, has separate translated category page which only list translated pages. Unknown. Yes, but translated pages are not added to the translated category page, unlike {{Lang}}. Unknown
Preview languages Yes Yes Yes English only

Usage

For existing pages using {{Lang}}:

  1. 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}}.
  2. 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.pngTip:You can use Notepad++ Notepad++ (or other software), and replace all (|suf=:de) with blank text.
  3. Remove the language suffixes on the language categories from all language subpages. For example, [[Category:Source:ru]] will become.
  4. Move the translated page (From Example article:<language code> to new suffix Example article/<language code> (for example, Half-Life 2:zh-cn will become an Half-Life 2/zh). Done.
Icon-Important.pngImportant: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 {{Entity}} or {{Format}} templates, replace it with {{This is a}} template.
Todo: Should we bring back separate language categories (which Lang uses) or remove it like MultiPage?
Note.pngNote: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.

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.pngNote: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.pngTip:You can use {{Lang2|{{FULLPAGENAME}}}} instead of writing the article name, unless there are any issues mentioned above.
{{Lang2|{{FULLPAGENAME}}}}

{{Lang2|Template:Lang2}}
{{{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.pngNote: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
{{Lang2|L4D2 Level Design|Add-on Notes}}
{{Lang2|L4D Level Design|Panic Events}}
{{Lang2|Half-Life: Alyx Workshop Tools|Animgraph|AnimGraph Introduction}}
{{{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.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.
{{Lang2|title=Template:Lang2}}
{{{$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}}.
{{Lang2|$title=Template:Lang2}}
{{{notitle}}} This parameter can be used to change the title of the site page itself, but not for the title of the article itself.
{{Lang2|notitle=1}}
{{{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.
{{Lang2|noborder=1}}
{{{select}}} The selection mode of the title. 1 is the one-click selection (just like clicking the "1").
{{Lang2|Template:Lang2|select=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.