Template:Lang: Difference between revisions
mNo edit summary |
(This is a test change. If everything works correctly, then Special:WantedPages will no longer be filled with unnecessary links generated by the ifexist command) |
||
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 11: | Line 10: | ||
*The <code style="color:white">notitle</code> parameter can be used to change the title of the site page itself, but not for the Title of the article itself. | *The <code style="color:white">notitle</code> parameter can be used to change the title of the site page itself, but not for the Title of the article itself. | ||
*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. | ||
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''': | ||
<pre>{{lang|Category:Hello|title=Categoría:Hola| | <pre>{{lang|Category:Hello|title=Categoría:Hola|noline=1}}</pre> | ||
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 | 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. | ||
Line 73: | Line 70: | ||
|} | |} | ||
*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. | ||
Line 88: | Line 83: | ||
html to make the buttons appear in the header space | html to make the buttons appear in the header space | ||
--><div style=" | --><div style="padding:4px;line-height:29px;background:#262626;><!-- | ||
title | title | ||
Line 103: | Line 95: | ||
English | English | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}}}| {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:En.png|link=|English]] [[Category:English]] | background:#262626;">[[File:En.png|link={{{1}}}|English]] }} | background:#552020;">[[File:En.png|link=|English (page does not exist)]]}}</mark> <!-- | ||
Catalan - ca | Catalan - ca | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ca}}| {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:ca.png|link=|Català]] [[Category:Catalan]] | background:#262626;">[[File:ca.png|link={{{1}}}:ca|Català]] }} | background:#552020;">[[File:ca.png|link=|Català (page does not exist)]]}}</mark> <!-- | ||
Czech - cs | Czech - cs | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:cs}}| {{#ifeq: {{{1}}}:cs | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:cs.png|link=|Čeština]] [[Category:Czech]] | background:#262626;">[[File:cs.png|link={{{1}}}:cs|Čeština]] }} | background:#552020;">[[File:cs.png|link=|Čeština (page does not exist)]]}}</mark> <!-- | ||
German - de | German - de | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:de}}| {{#ifeq: {{{1}}}:de | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:de.png|link=|Deutsch]] [[Category:German]] | background:#262626;">[[File:de.png|link={{{1}}}:de|Deutsch]] }} | background:#552020;">[[File:de.png|link=|Deutsch (page does not exist)]]}}</mark> <!-- | ||
Spanish - es | Spanish - es | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:es.png|link=|Español]] [[Category:Spanish]] | background:#262626;">[[File:es.png|link={{{1}}}:es|Español]] }} | background:#552020;">[[File:es.png|link=|Español (page does not exist)]]}}</mark> <!-- | ||
French - fr | French - fr | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:fr}}| {{#ifeq: {{{1}}}:fr | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:fr.png|link=|Français]] [[Category:French]] | background:#262626;">[[File:fr.png|link={{{1}}}:fr|Français]] }} | background:#552020;">[[File:fr.png|link=|Français (page does not exist)]]}}</mark> <!-- | ||
Hungarian - hu | Hungarian - hu | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:hu}}| {{#ifeq: {{{1}}}:hu | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:hu.png|link=|Magyar]] [[Category:Hungarian]] | background:#262626;">[[File:hu.png|link={{{1}}}:hu|Magyar]] }} | background:#552020;">[[File:hu.png|link=|Magyar (page does not exist)]]}}</mark> <!-- | ||
Italian - it | Italian - it | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:it}}| {{#ifeq: {{{1}}}:it | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:it.png|link=|Italiano]] [[Category:Italian]] | background:#262626;">[[File:it.png|link={{{1}}}:it|Italiano]] }} | background:#552020;">[[File:it.png|link=|Italiano (page does not exist)]]}}</mark> <!-- | ||
Dutch - nl | Dutch - nl | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:nl}}| {{#ifeq: {{{1}}}:nl | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:nl.png|link=|Nederlands]] [[Category:Dutch]] | background:#262626;">[[File:nl.png|link={{{1}}}:nl|Nederlands]] }} | background:#552020;">[[File:nl.png|link=|Nederlands (page does not exist)]]}}</mark> <!-- | ||
Norwegian - no | Norwegian - no | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:no}}| {{#ifeq: {{{1}}}:no | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:no.png|link=|Norsk]] [[Category:Norwegian]] | background:#262626;">[[File:no.png|link={{{1}}}:no|Norsk]] }} | background:#552020;">[[File:no.png|link=|Norsk (page does not exist)]]}}</mark> <!-- | ||
Polish - pl | Polish - pl | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pl}}| {{#ifeq: {{{1}}}:pl | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:pl.png|link=|Polski]] [[Category:Polish]] | background:#262626;">[[File:pl.png|link={{{1}}}:pl|Polski]] }} | background:#552020;">[[File:pl.png|link=|Polski (page does not exist)]]}}</mark> <!-- | ||
Portuguese - pt | Portuguese - pt | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt}}| {{#ifeq: {{{1}}}:pt | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:pt.png|link=|Português]] [[Category:Portuguese]] | background:#262626;">[[File:pt.png|link={{{1}}}:pt|Português]] }} | background:#552020;">[[File:pt.png|link=|Português (page does not exist)]]}}</mark> <!-- | ||
Brazilian Portuguese - pt-br | Brazilian Portuguese - pt-br | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt-br}}| {{#ifeq: {{{1}}}:pt-br | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:pt-br.png|link=|Português-Brasileiro]] [[Category:Brazilian Portuguese]] | background:#262626;">[[File:pt-br.png|link={{{1}}}:pt-br|Português-Brasileiro]] }} | background:#552020;">[[File:pt-br.png|link=|Português-Brasileiro (page does not exist)]]}}</mark> <!-- | ||
Russian - ru | Russian - ru | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ru}}| {{#ifeq: {{{1}}}:ru | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:ru.png|link=|Русский]] [[Category:Russian]] | background:#262626;">[[File:ru.png|link={{{1}}}:ru|Русский]] }} | background:#552020;">[[File:ru.png|link=|Русский (page does not exist)]]}}</mark> <!-- | ||
Ukrainian - ua | Ukrainian - ua | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ua}}| {{#ifeq: {{{1}}}:ua | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:ua.png|link=|Українська]] [[Category:Ukrainian]] | background:#262626;">[[File:ua.png|link={{{1}}}:ua|Українська]] }} | background:#552020;">[[File:ua.png|link=|Українська (page does not exist)]]}}</mark> <!-- | ||
Swedish - sv | Swedish - sv | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:sv}}| {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:sv.png|link=|Svenska]] [[Category:Swedish]] | background:#262626;">[[File:sv.png|link={{{1}}}:sv|Svenska]] }} | background:#552020;">[[File:sv.png|link=|Svenska (page does not exist)]]}}</mark> <!-- | ||
Turkish - tr | Turkish - tr | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:tr}}| {{#ifeq: {{{1}}}:tr | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:tr.png|link=|Türkçe]] [[Category:Turkish]] | background:#262626;">[[File:tr.png|link={{{1}}}:tr|Türkçe]] }} | background:#552020;">[[File:tr.png|link=|Türkçe (page does not exist)]]}}</mark> <!-- | ||
Japanese - jp | Japanese - jp | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:jp}}| {{#ifeq: {{{1}}}:jp | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:tr.png|link=|日本語]] [[Category:Japanese]] | background:#262626;">[[File:jp.png|link={{{1}}}:jp|日本語]] }} | background:#552020;">[[File:jp.png|link=|日本語 (page does not exist)]]}}</mark> <!-- | ||
Simplified Chinese - zh-cn | Simplified Chinese - zh-cn | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-cn}}| {{#ifeq: {{{1}}}:zh-cn | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:cn.png|link=|简体中文]] [[Category:Simplified Chinese]] | background:#262626;">[[File:cn.png|link={{{1}}}:zh-cn|简体中文]] }} | background:#552020;">[[File:cn.png|link=|简体中文 (page does not exist)]]}}</mark> <!-- | ||
Taiwanese Mandarin - zh-tw | Taiwanese Mandarin - zh-tw | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:zh-tw}}| {{#ifeq: {{{1}}}:zh-tw | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:tw.png|link=|简体中文]] [[Category:Taiwanese Mandarin]] | background:#262626;">[[File:tw.png|link={{{1}}}:zh-tw|简体中文]] }} | background:#552020;">[[File:tw.png|link=|简体中文 (page does not exist)]]}}</mark> <!-- | ||
Korean - ko | Korean - ko | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ko}}| {{#ifeq: {{{1}}}:ko | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:ko.png|link=|한국어]] [[Category:Korean]] | background:#262626;">[[File:ko.png|link={{{1}}}:ko|한국어]] }} | background:#552020;">[[File:ko.png|link=|한국어 (page does not exist)]]}}</mark> <!-- | ||
Georgian - ka | Georgian - ka | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ka}}| {{#ifeq: {{{1}}}:ka | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:ka.png|link=|ქართული ენა]] [[Category:Georgian]] | background:#262626;">[[File:ka.png|link={{{1}}}:ka|ქართული ენა]] }} | background:#552020;">[[File:ka.png|link=|ქართული ენა (page does not exist)]]}}</mark> <!-- | ||
Hebrew - he | Hebrew - he | ||
-->{{# | --><mark style="border:1px solid #65635F;padding:4px;{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:he}}| {{#ifeq: {{{1}}}:he | {{ARTICLEPAGENAME}} | background:#3A3A3A;">[[File:he.png|link=|עִברִית]] [[Category:Hebrew]] | background:#262626;">[[File:he.png|link={{{1}}}:he|עִברִית]] }} | background:#552020;">[[File:he.png|link=|עִברִית (page does not exist)]]}}</mark></div> |
Revision as of 08:52, 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.
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.