Template:Lang: Difference between revisions
(made the template smaller and removed nonexistent pages) |
(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) |
||
Line 1: | Line 1: | ||
<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. | <noinclude>{{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. | |||
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 12: | Line 13: | ||
*The <code style="color:white">noline</code> 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 <code style="color:white">noline</code> 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 <code style="color:white">noborder</code> 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''': | Here's an example for a hypothetical Spanish page called '''Category:Hello:es''': | ||
Line 83: | Line 86: | ||
html to make the buttons appear in the header space | html to make the buttons appear in the header space | ||
--><div style="padding:2px;line-height: | --><div style="position:relative;top:-31px;margin-bottom:-40px;float:right;padding:2px;line-height:11px;background:#262626;<!-- | ||
taking away of the icon borders | |||
-->{{#if: {{{noborder|}}} | margin-top:5px;border:0; | border:1px solid #65635F;border-bottom:0;}}"><!-- | |||
title | title | ||
Line 95: | Line 101: | ||
English | English | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}}}| {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}}}| {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:En.png|link=|English]]</mark> [[Category:English]] | [[File:En.png|link={{{1}}}|English]] }} | }} <!-- | ||
Catalan - ca | Catalan - ca | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ca}}| {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ca}}| {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:ca.png|link=|Català]]</mark> [[Category:Catalan]] | [[File:ca.png|link={{{1}}}:ca|Català]] }} | }} <!-- | ||
Czech - cs | Czech - cs | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:cs}}| {{#ifeq: {{{1}}}:cs | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:cs}}| {{#ifeq: {{{1}}}:cs | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:cs.png|link=|Čeština]]</mark> [[Category:Czech]] | | ||
[[File:cs.png|link={{{1}}}:cs|Čeština]] }} | }} <!-- | |||
German - de | German - de | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:de}}| {{#ifeq: {{{1}}}:de | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:de}}| {{#ifeq: {{{1}}}:de | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:de.png|link=|Deutsch]]</mark> [[Category:German]] | [[File:de.png|link={{{1}}}:de|Deutsch]] }} | }} <!-- | ||
Spanish - es | Spanish - es | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#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]] }} | }} <!-- | ||
French - fr | French - fr | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:fr}}| {{#ifeq: {{{1}}}:fr | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:fr}}| {{#ifeq: {{{1}}}:fr | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:fr.png|link=|Français]]</mark> [[Category:French]] | [[File:fr.png|link={{{1}}}:fr|Français]] }} | }} <!-- | ||
Hungarian - hu | Hungarian - hu | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:hu}}| {{#ifeq: {{{1}}}:hu | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:hu}}| {{#ifeq: {{{1}}}:hu | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:hu.png|link=|Magyar]]</mark> [[Category:Hungarian]] | [[File:hu.png|link={{{1}}}:hu|Magyar]] }} | }} <!-- | ||
Italian - it | Italian - it | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:it}}| {{#ifeq: {{{1}}}:it | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:it}}| {{#ifeq: {{{1}}}:it | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:it.png|link=|Italiano]]</mark> [[Category:Italian]] | [[File:it.png|link={{{1}}}:it|Italiano]] }} | }} <!-- | ||
Dutch - nl | Dutch - nl | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:nl}}| {{#ifeq: {{{1}}}:nl | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:nl}}| {{#ifeq: {{{1}}}:nl | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:nl.png|link=|Nederlands]]</mark> [[Category:Dutch]] | [[File:nl.png|link={{{1}}}:nl|Nederlands]] }} | }} <!-- | ||
Norwegian - no | Norwegian - no | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:no}}| {{#ifeq: {{{1}}}:no | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:no}}| {{#ifeq: {{{1}}}:no | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:no.png|link=|Norsk]]</mark> [[Category:Norwegian]] | [[File:no.png|link={{{1}}}:no|Norsk]] }} | }} <!-- | ||
Polish - pl | Polish - pl | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pl}}| {{#ifeq: {{{1}}}:pl | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pl}}| {{#ifeq: {{{1}}}:pl | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:pl.png|link=|Polski]]</mark> [[Category:Polish]] | [[File:pl.png|link={{{1}}}:pl|Polski]] }} | }} <!-- | ||
Portuguese - pt | Portuguese - pt | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt}}| {{#ifeq: {{{1}}}:pt | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt}}| {{#ifeq: {{{1}}}:pt | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:pt.png|link=|Português]]</mark> [[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}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt-br}}| {{#ifeq: {{{1}}}:pt-br | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:pt-br.png|link=|Português-Brasileiro]]</mark> [[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}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ru}}| {{#ifeq: {{{1}}}:ru | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:ru.png|link=|Русский]]</mark> [[Category:Russian]] | [[File:ru.png|link={{{1}}}:ru|Русский]] }} | }} <!-- | ||
Ukrainian - ua | Ukrainian - ua | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ua}}| {{#ifeq: {{{1}}}:ua | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ua}}| {{#ifeq: {{{1}}}:ua | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:ua.png|link=|Українська]]</mark> [[Category:Ukrainian]] | [[File:ua.png|link={{{1}}}:ua|Українська]] }} | }} <!-- | ||
Swedish - sv | Swedish - sv | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:sv}}| {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:sv}}| {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:sv.png|link=|Svenska]]</mark> [[Category:Swedish]] | [[File:sv.png|link={{{1}}}:sv|Svenska]] }} | }} <!-- | ||
Turkish - tr | Turkish - tr | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:tr}}| {{#ifeq: {{{1}}}:tr | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:tr}}| {{#ifeq: {{{1}}}:tr | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:tr.png|link=|Türkçe]]</mark> [[Category:Turkish]] | [[File:tr.png|link={{{1}}}:tr|Türkçe]] }} | }} <!-- | ||
Japanese - jp | Japanese - jp | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:jp}}| {{#ifeq: {{{1}}}:jp | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:jp}}| {{#ifeq: {{{1}}}:jp | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:tr.png|link=|日本語]]</mark> [[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}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-cn}}| {{#ifeq: {{{1}}}:zh-cn | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:cn.png|link=|简体中文]]</mark> [[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}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-tw}}| {{#ifeq: {{{1}}}:zh-tw | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:tw.png|link=|简体中文]]</mark> [[Category:Taiwanese Mandarin]] | [[File:tw.png|link={{{1}}}:zh-tw|简体中文]] }} | }} <!-- | ||
Korean - ko | Korean - ko | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ko}}| {{#ifeq: {{{1}}}:ko | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ko}}| {{#ifeq: {{{1}}}:ko | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:ko.png|link=|한국어]]</mark> [[Category:Korean]] | [[File:ko.png|link={{{1}}}:ko|한국어]] }} | }} <!-- | ||
Georgian - ka | Georgian - ka | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ka}}| {{#ifeq: {{{1}}}:ka | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ka}}| {{#ifeq: {{{1}}}:ka | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:ka.png|link=|ქართული ენა]]</mark> [[Category:Georgian]] | [[File:ka.png|link={{{1}}}:ka|ქართული ენა]] }} | }}</mark> <!-- | ||
Hebrew - he | Hebrew - he | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:he}}| {{#ifeq: {{{1}}}:he | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:he}}| {{#ifeq: {{{1}}}:he | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;background:#3A3A3A;">[[File:he.png|link=|עִברִית]]</mark> [[Category:Hebrew]] | [[File:he.png|link={{{1}}}:he|עִברִית]] }} | }}</div> |
Revision as of 15:12, 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.