Template:Lang

From Valve Developer Community
Jump to: navigation, search
Red x.png
This template (and its redirect) is Wikipedia icon Deprecated. Its use is not recommended and its functionality may be compromised.
Please use {{MultiPage}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.

Additional notes:
Template pages should use {{Autolang}} or a Strings subpage on template pages, and to preview translations use {{Uselangflags}} surrounded by <noinclude>. Documentation on how to use it can be found in that template and on the Valve Developer Community:Alternative Languages. Many new languages (such as Ελληνικά (el) Greek and Tiếng Việt (vi) Vietnamese) are only supported in {{MultiPage}}.

You can help us converting {{Lang}} to {{MultiPage}} by checking old pages using Lang template at Pages using Lang category and in the Pages that link to "Template:Lang".
Warning.pngWarning:If you are moving the page, you MUST move the respective language page and edit the template on main page and put the new title on it aswell in order to prevent issues.
Curly brackets white.pngTemplate Documentation
Icon-translate.png
View
Edit
Page history

This template is an improved version of {{Otherlang2}}. It retains all the functionality and automatically detects which languages a page has been translated into. It works on English and non-English pages, with or without namespaces. Otherlang2 may still be used, in the rare case that a translated page does not follow the wiki's standard method for translated page titles. As of 2023 (and still ongoing), it is slowly being replaced by {{MultiPage}}, which supports more languages and they are fully ISO 639 compliant.

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-cn, 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.
{{lang|Template:Lang}}
{{{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:Do not link subpages with "/"! Use "|" instead of "/". Therefore, the template can link the pages correctly.
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:zh-cn/Panic Events:zh-cn
{{lang|L4D2 Level Design|Add-on Notes}}
{{lang|L4D Level Design|Panic Events}}
{{lang|Half-Life: Alyx Workshop Tools|Animgraph|AnimGraph Introduction}}
{{{title}}} 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.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.
{{lang|title=Template:Lang}}
{{{$title}}} This parameter can be used to change the text of the page titlebar and place the title under the <code> tag - {{lang|Template:Lang|$title=$model}}.
{{lang|$title=Template:Lang}}
{{{notitle}}} This parameter can be used to change the title of the site page itself, but not for the title of the article itself.
{{lang|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.
{{lang|noborder=1}}
{{{select}}} The selection mode of the title. 1 is the one-click selection (just like clicking the "1").
{{lang|Template:Lang|select=1}}
{{{up}}}
Blank image.pngTodo: Document it.
Blank image.pngTodo:

Examples

Here's an example for a hypothetical Spanish page called Category:Hello:es:

{{lang|Category:Hello|title=Categoría:Hola}}

This will add icons for all the versions of this page in different languages. It will also change the displayed title to a Spanish version of the name.

Currently Supported Languages

Currently Supported Languages
Language Page name Icon
English Page_name English (en)
Esperanto Page_name:eo Esperanto (eo)
Catalan Page_name:ca català (ca)
Czech Page_name:cs čeština (cs)
German Page_name:de Deutsch (de)
Spanish Page_name:es español (es)
Estonian Page_name:et eesti (et)
French Page_name:fr français (fr)
Hungarian Page_name:hu magyar (hu)
Italian Page_name:it italiano (it)
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)
Ukrainian Page_name:uk українська (uk)
Swedish Page_name:sv svenska (sv)
Turkish Page_name:tr Türkçe (tr)
Japanese Page_name:ja 日本語 (ja)
Chinese (PRC) Page_name:zh-cn 中文 (zh)
Chinese (Taiwan) Page_name:zh-tw 中文(台灣)‎ (zh-tw)
Korean Page_name:ko 한국어 (ko)
Georgian Page_name:ka ქართული (ka)
Hebrew Page_name:he עברית (he)
  • Also, this template automatically adds a page language category at the bottom of the page.
Note.pngNote:Most, not all of them of these language codes are compliant ISO 639 codes.