Difference between revisions of "Template:Lang"

From Valve Developer Community
Jump to: navigation, search
m (Use japanese flag, not turkish.)
m (added Estonian)
 
Line 34: Line 34:
 
|-  
 
|-  
 
|Spanish                ||Page_name:es      ||[[File:Es.png]]
 
|Spanish                ||Page_name:es      ||[[File:Es.png]]
 +
|-
 +
|Estonian              ||Page_name:et      ||[[File:Et.png]]
 
|-  
 
|-  
 
|French                ||Page_name:fr      ||[[File:Fr.png]]
 
|French                ||Page_name:fr      ||[[File:Fr.png]]
Line 113: Line 115:
 
Spanish - es
 
Spanish - es
 
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:es.png|link=|Español]]</mark> [[Category:Spanish]] | [[File:es.png|link={{{1}}}:es|Español]] }} | }} <!--
 
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:es.png|link=|Español]]</mark> [[Category:Spanish]] | [[File:es.png|link={{{1}}}:es|Español]] }} | }} <!--
 +
 +
Estonian - et
 +
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:et}}| {{#ifeq: {{{1}}}:et | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A">[[File:et.png|link=|Eestlane]]</mark> [[Category:Estonian]] | [[File:et.png|link={{{1}}}:et|Eestlane]] }} | }} <!--
  
 
French - fr
 
French - fr

Latest revision as of 08:58, 27 September 2021

English

This template is an improved version of {{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).
Warning.png 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.
  • The $title 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}}.
  • The notitle parameter can be used to change the title of the site page itself, but not for the Title of the article itself.
  • The noline parameter can be set to 1 to hide the line under the title. If you don't plan on using it, don't bother defining it.
  • The noborder 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.

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

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

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 line under the title.

Currently supported languages:

Language Page name Icon
English Page_name En.png
Catalan Page_name:ca Ca.png
Czech Page_name:cs Cs.png
German Page_name:de De.png
Spanish Page_name:es Es.png
Estonian Page_name:et Et.png
French Page_name:fr Fr.png
Hungarian Page_name:hu Hu.png
Italian Page_name:it It.png
Dutch Page_name:nl Nl.png
Norwegian Page_name:no No.png
Polish Page_name:pl Pl.png
Portuguese Page_name:pt Pt.png
Portuguese (Brazilian) Page_name:pt-br Pt-br.png
Russian Page_name:ru Ru.png
Ukrainian Page_name:ua Ua.png
Swedish Page_name:sv Sv.png
Turkish Page_name:tr Tr.png
Japanese Page_name:jp Jp.png
Chinese (PRC) Page_name:zh-cn Cn.png
Chinese (Taiwan) Page_name:zh-tw Tw.png
Korean Page_name:ko Ko.png
Georgian Page_name:ka Ka.png
Hebrew Page_name:he He.png
  • Also, this template automatically adds a page language category at the bottom of the page.

For information on how the template detects other languages, view this page's source code.