Template:Lang: Difference between revisions
(returned icons to the top right of the screen. But left a new system according to which this template will no longer litter Special:WantedPages) |
(Raised the template a little; removed the appearance of the icon of the article you are on) |
||
Line 1: | Line 1: | ||
<noinclude> | <noinclude>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. | |||
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. <code>ai_changehintgroup</code> must be written as <code>Ai changehintgroup</code>. | 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. <code>ai_changehintgroup</code> must be written as <code>Ai changehintgroup</code>. | ||
Line 54: | Line 53: | ||
|Russian ||Page_name:ru ||[[File:Ru.png]] | |Russian ||Page_name:ru ||[[File:Ru.png]] | ||
|- | |- | ||
|Ukrainian | |Ukrainian ||Page_name:ua ||[[File:ua.png]] | ||
|- | |- | ||
|Swedish ||Page_name:sv ||[[File:Sv.png]] | |Swedish ||Page_name:sv ||[[File:Sv.png]] | ||
Line 86: | Line 85: | ||
html to make the buttons appear in the header space | html to make the buttons appear in the header space | ||
--><div style="position:relative;top:- | --><div style="position:relative;top:-32px;margin-bottom:-40px;float:right;padding:2px;line-height:11px;background:#262626;<!-- | ||
taking away of the icon borders | taking away of the icon borders | ||
Line 101: | Line 100: | ||
English | English | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}}}| {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}}}| {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | [[Category:English]] | [[File:En.png|link={{{1}}}|English]] }} | }} <!-- | ||
Catalan - ca | Catalan - ca | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ca}}| {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ca}}| {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | [[Category:Catalan]] | [[File:ca.png|link={{{1}}}:ca|Català]] }} | }} <!-- | ||
Czech - cs | Czech - cs | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:cs}}| {{#ifeq: {{{1}}}:cs | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:cs}}| {{#ifeq: {{{1}}}:cs | {{ARTICLEPAGENAME}} | [[Category:Czech]] | | ||
[[File:cs.png|link={{{1}}}:cs|Čeština]] }} | }} <!-- | [[File:cs.png|link={{{1}}}:cs|Čeština]] }} | }} <!-- | ||
German - de | German - de | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:de}}| {{#ifeq: {{{1}}}:de | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:de}}| {{#ifeq: {{{1}}}:de | {{ARTICLEPAGENAME}} | [[Category:German]] | [[File:de.png|link={{{1}}}:de|Deutsch]] }} | }} <!-- | ||
Spanish - es | Spanish - es | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | [[Category:Spanish]] | [[File:es.png|link={{{1}}}:es|Español]] }} | }} <!-- | ||
French - fr | French - fr | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:fr}}| {{#ifeq: {{{1}}}:fr | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:fr}}| {{#ifeq: {{{1}}}:fr | {{ARTICLEPAGENAME}} | [[Category:French]] | [[File:fr.png|link={{{1}}}:fr|Français]] }} | }} <!-- | ||
Hungarian - hu | Hungarian - hu | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:hu}}| {{#ifeq: {{{1}}}:hu | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:hu}}| {{#ifeq: {{{1}}}:hu | {{ARTICLEPAGENAME}} | [[Category:Hungarian]] | [[File:hu.png|link={{{1}}}:hu|Magyar]] }} | }} <!-- | ||
Italian - it | Italian - it | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:it}}| {{#ifeq: {{{1}}}:it | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:it}}| {{#ifeq: {{{1}}}:it | {{ARTICLEPAGENAME}} | [[Category:Italian]] | [[File:it.png|link={{{1}}}:it|Italiano]] }} | }} <!-- | ||
Dutch - nl | Dutch - nl | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:nl}}| {{#ifeq: {{{1}}}:nl | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:nl}}| {{#ifeq: {{{1}}}:nl | {{ARTICLEPAGENAME}} | [[Category:Dutch]] | [[File:nl.png|link={{{1}}}:nl|Nederlands]] }} | }} <!-- | ||
Norwegian - no | Norwegian - no | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:no}}| {{#ifeq: {{{1}}}:no | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:no}}| {{#ifeq: {{{1}}}:no | {{ARTICLEPAGENAME}} | [[Category:Norwegian]] | [[File:no.png|link={{{1}}}:no|Norsk]] }} | }} <!-- | ||
Polish - pl | Polish - pl | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pl}}| {{#ifeq: {{{1}}}:pl | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pl}}| {{#ifeq: {{{1}}}:pl | {{ARTICLEPAGENAME}} | [[Category:Polish]] | [[File:pl.png|link={{{1}}}:pl|Polski]] }} | }} <!-- | ||
Portuguese - pt | Portuguese - pt | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt}}| {{#ifeq: {{{1}}}:pt | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt}}| {{#ifeq: {{{1}}}:pt | {{ARTICLEPAGENAME}} | [[Category:Portuguese]] | [[File:pt.png|link={{{1}}}:pt|Português]] }} | }} <!-- | ||
Brazilian Portuguese - pt-br | Brazilian Portuguese - pt-br | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt-br}}| {{#ifeq: {{{1}}}:pt-br | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt-br}}| {{#ifeq: {{{1}}}:pt-br | {{ARTICLEPAGENAME}} | [[Category:Brazilian Portuguese]] | [[File:pt-br.png|link={{{1}}}:pt-br|Português-Brasileiro]] }} | }} <!-- | ||
Russian - ru | Russian - ru | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ru}}| {{#ifeq: {{{1}}}:ru | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ru}}| {{#ifeq: {{{1}}}:ru | {{ARTICLEPAGENAME}} | [[Category:Russian]] | [[File:ru.png|link={{{1}}}:ru|Русский]] }} | }} <!-- | ||
Ukrainian - ua | Ukrainian - ua | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ua}}| {{#ifeq: {{{1}}}:ua | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ua}}| {{#ifeq: {{{1}}}:ua | {{ARTICLEPAGENAME}} | [[Category:Ukrainian]] | [[File:ua.png|link={{{1}}}:ua|Українська]] }} | }} <!-- | ||
Swedish - sv | Swedish - sv | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:sv}}| {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:sv}}| {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | [[Category:Swedish]] | [[File:sv.png|link={{{1}}}:sv|Svenska]] }} | }} <!-- | ||
Turkish - tr | Turkish - tr | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:tr}}| {{#ifeq: {{{1}}}:tr | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:tr}}| {{#ifeq: {{{1}}}:tr | {{ARTICLEPAGENAME}} | [[Category:Turkish]] | [[File:tr.png|link={{{1}}}:tr|Türkçe]] }} | }} <!-- | ||
Japanese - jp | Japanese - jp | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:jp}}| {{#ifeq: {{{1}}}:jp | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:jp}}| {{#ifeq: {{{1}}}:jp | {{ARTICLEPAGENAME}} | [[Category:Japanese]] | [[File:jp.png|link={{{1}}}:jp|日本語]] }} | }} <!-- | ||
Simplified Chinese - zh-cn | Simplified Chinese - zh-cn | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-cn}}| {{#ifeq: {{{1}}}:zh-cn | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-cn}}| {{#ifeq: {{{1}}}:zh-cn | {{ARTICLEPAGENAME}} | [[Category:Simplified Chinese]] | [[File:cn.png|link={{{1}}}:zh-cn|简体中文]] }} | }} <!-- | ||
Taiwanese Mandarin - zh-tw | Taiwanese Mandarin - zh-tw | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-tw}}| {{#ifeq: {{{1}}}:zh-tw | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-tw}}| {{#ifeq: {{{1}}}:zh-tw | {{ARTICLEPAGENAME}} | [[Category:Taiwanese Mandarin]] | [[File:tw.png|link={{{1}}}:zh-tw|简体中文]] }} | }} <!-- | ||
Korean - ko | Korean - ko | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ko}}| {{#ifeq: {{{1}}}:ko | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ko}}| {{#ifeq: {{{1}}}:ko | {{ARTICLEPAGENAME}} | [[Category:Korean]] | [[File:ko.png|link={{{1}}}:ko|한국어]] }} | }} <!-- | ||
Georgian - ka | Georgian - ka | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ka}}| {{#ifeq: {{{1}}}:ka | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ka}}| {{#ifeq: {{{1}}}:ka | {{ARTICLEPAGENAME}} | [[Category:Georgian]] | [[File:ka.png|link={{{1}}}:ka|ქართული ენა]] }} | }}</mark> <!-- | ||
Hebrew - he | Hebrew - he | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:he}}| {{#ifeq: {{{1}}}:he | {{ARTICLEPAGENAME}} | | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:he}}| {{#ifeq: {{{1}}}:he | {{ARTICLEPAGENAME}} | [[Category:Hebrew]] | [[File:he.png|link={{{1}}}:he|עִברִית]] }} | }}</div> |
Revision as of 15:39, 16 September 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
$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:
- 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.