Template:Lang: Difference between revisions
(updated the description and capabilities of this template) |
mNo edit summary |
||
Line 1: | Line 1: | ||
<noinclude> | <noinclude>{{lang|Template:Lang}} | ||
{{lang|Template:Lang}} | |||
This template is an improved version of [[:Template:Otherlang2]]. It retains all the functionality, adds Hebrew properly, 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 [[Valve Developer Community:Alternative Languages|standard method]] for translated page titles. | This template is an improved version of [[:Template:Otherlang2]]. It retains all the functionality, adds Hebrew properly, 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 [[Valve Developer Community:Alternative Languages|standard method]] for translated page titles. | ||
Line 49: | Line 26: | ||
|Catalan ||Page_name:ca ||[[File:Ca.png]] | |Catalan ||Page_name:ca ||[[File:Ca.png]] | ||
|- | |- | ||
| | |Czech ||Page_name:cs ||[[File:Cs.png]] | ||
|- | |- | ||
| | |German ||Page_name:de ||[[File:De.png]] | ||
|- | |- | ||
| | |Spanish ||Page_name:es ||[[File:Es.png]] | ||
|- | |- | ||
|French ||Page_name:fr ||[[File:Fr.png]] | |French ||Page_name:fr ||[[File:Fr.png]] | ||
|- | |- | ||
|Hungarian ||Page_name:hu ||[[File:Hu.png]] | |Hungarian ||Page_name:hu ||[[File:Hu.png]] | ||
Line 69: | Line 38: | ||
|Italian ||Page_name:it ||[[File:It.png]] | |Italian ||Page_name:it ||[[File:It.png]] | ||
|- | |- | ||
| | |Dutch ||Page_name:nl ||[[File:nl.png]] | ||
|- | |- | ||
|Norwegian ||Page_name:no ||[[File:No.png]] | |Norwegian ||Page_name:no ||[[File:No.png]] | ||
Line 84: | Line 51: | ||
|- | |- | ||
|Ukrainian ||Page_name:ua ||[[File:ua.png]] | |Ukrainian ||Page_name:ua ||[[File:ua.png]] | ||
|- | |- | ||
|Swedish ||Page_name:sv ||[[File:Sv.png]] | |Swedish ||Page_name:sv ||[[File:Sv.png]] | ||
|- | |- | ||
|Turkish ||Page_name:tr ||[[File:Tr.png]] | |Turkish ||Page_name:tr ||[[File:Tr.png]] | ||
|- | |||
|Japanese ||Page_name:jp ||[[File:Jp.png]] | |||
|- | |||
|Chinese (PRC) ||Page_name:zh-cn ||[[File:Cn.png]] | |||
|- | |||
|Chinese (Taiwan) ||Page_name:zh-tw ||[[File:Tw.png]] | |||
|- | |||
|Korean ||Page_name:ko ||[[File:Ko.png]] | |||
|- | |||
|Georgian ||Page_name:ka ||[[File:Ka.png]] | |||
|- | |||
|Hebrew ||Page_name:he ||[[File:He.png]] | |||
|} | |} | ||
Also, this template automatically adds a page language category at the bottom of the page. | Also, this template automatically adds a page language category at the bottom of the page. |
Revision as of 15:16, 16 May 2021

This template is an improved version of Template:Otherlang2. It retains all the functionality, adds Hebrew properly, 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.
Unlike otherlang2, this template requires an unnamed parameter to be defined to work. The contents of it should be the full name of the page the template is being applied on, including namespaces such as Help:. It should not include any language suffixes, however, such as :ru. 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
.
The title
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).

The noborder
parameter can be set to 1
to hide the border around icons. If you don't plan on using it, don't bother defining it.
Here's an example for a hypothetical Spanish page called Category:Hello:es:
{{lang|Category:Hello|title=Categoría:Hola|noborder=1}}
Here's one more example for a Russian page called Your_First_Map:ru:
{{lang|Your First Map|title=Ваша первая карта}}
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, and hide the icon borders.
Currently supported languages:
Also, this template automatically adds a page language category at the bottom of the page.
[Todo] simplify code for <mark> tags
For information on how the template detects other languages, view this page's source code.