Template:Lang: Difference between revisions
(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) |
(made the template smaller and removed nonexistent pages) |
||
Line 83: | Line 83: | ||
html to make the buttons appear in the header space | html to make the buttons appear in the header space | ||
--><div style="padding: | --><div style="padding:2px;line-height:27px;background:#262626;><!-- | ||
title | title | ||
Line 95: | Line 95: | ||
English | English | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}}}| {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:En.png|link=|English]] [[Category:English]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:En.png|link={{{1}}}|English]] }} | }}</mark> <!-- | ||
Catalan - ca | Catalan - ca | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ca}}| {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:ca.png|link=|Català]] [[Category:Catalan]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:ca.png|link={{{1}}}:ca|Català]] }} | }}</mark> <!-- | ||
Czech - cs | Czech - cs | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:cs}}| {{#ifeq: {{{1}}}:cs | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:cs.png|link=|Čeština]] [[Category:Czech]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:cs.png|link={{{1}}}:cs|Čeština]] }} | }}</mark> <!-- | ||
German - de | German - de | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:de}}| {{#ifeq: {{{1}}}:de | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:de.png|link=|Deutsch]] [[Category:German]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:de.png|link={{{1}}}:de|Deutsch]] }} | }}</mark> <!-- | ||
Spanish - es | Spanish - es | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:es}}| {{#ifeq: {{{1}}}:es | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:es.png|link=|Español]] [[Category:Spanish]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:es.png|link={{{1}}}:es|Español]] }} | }}</mark> <!-- | ||
French - fr | French - fr | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:fr}}| {{#ifeq: {{{1}}}:fr | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:fr.png|link=|Français]] [[Category:French]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:fr.png|link={{{1}}}:fr|Français]] }} | }}</mark> <!-- | ||
Hungarian - hu | Hungarian - hu | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:hu}}| {{#ifeq: {{{1}}}:hu | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:hu.png|link=|Magyar]] [[Category:Hungarian]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:hu.png|link={{{1}}}:hu|Magyar]] }} | }}</mark> <!-- | ||
Italian - it | Italian - it | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:it}}| {{#ifeq: {{{1}}}:it | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:it.png|link=|Italiano]] [[Category:Italian]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:it.png|link={{{1}}}:it|Italiano]] }} | }}</mark> <!-- | ||
Dutch - nl | Dutch - nl | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:nl}}| {{#ifeq: {{{1}}}:nl | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:nl.png|link=|Nederlands]] [[Category:Dutch]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:nl.png|link={{{1}}}:nl|Nederlands]] }} | }}</mark> <!-- | ||
Norwegian - no | Norwegian - no | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:no}}| {{#ifeq: {{{1}}}:no | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:no.png|link=|Norsk]] [[Category:Norwegian]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:no.png|link={{{1}}}:no|Norsk]] }} | }}</mark> <!-- | ||
Polish - pl | Polish - pl | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pl}}| {{#ifeq: {{{1}}}:pl | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:pl.png|link=|Polski]] [[Category:Polish]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:pl.png|link={{{1}}}:pl|Polski]] }} | }}</mark> <!-- | ||
Portuguese - pt | Portuguese - pt | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:pt}}| {{#ifeq: {{{1}}}:pt | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:pt.png|link=|Português]] [[Category:Portuguese]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:pt.png|link={{{1}}}:pt|Português]] }} | }}</mark> <!-- | ||
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;padding:2px;background:#3A3A3A;">[[File:pt-br.png|link=|Português-Brasileiro]] [[Category:Brazilian Portuguese]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:pt-br.png|link={{{1}}}:pt-br|Português-Brasileiro]] }} | }}</mark> <!-- | ||
Russian - ru | Russian - ru | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ru}}| {{#ifeq: {{{1}}}:ru | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:ru.png|link=|Русский]] [[Category:Russian]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:ru.png|link={{{1}}}:ru|Русский]] }} | }}</mark> <!-- | ||
Ukrainian - ua | Ukrainian - ua | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ua}}| {{#ifeq: {{{1}}}:ua | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:ua.png|link=|Українська]] [[Category:Ukrainian]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:ua.png|link={{{1}}}:ua|Українська]] }} | }}</mark> <!-- | ||
Swedish - sv | Swedish - sv | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:sv}}| {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:sv.png|link=|Svenska]] [[Category:Swedish]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:sv.png|link={{{1}}}:sv|Svenska]] }} | }}</mark> <!-- | ||
Turkish - tr | Turkish - tr | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:tr}}| {{#ifeq: {{{1}}}:tr | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:tr.png|link=|Türkçe]] [[Category:Turkish]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:tr.png|link={{{1}}}:tr|Türkçe]] }} | }}</mark> <!-- | ||
Japanese - jp | Japanese - jp | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:jp}}| {{#ifeq: {{{1}}}:jp | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:tr.png|link=|日本語]] [[Category:Japanese]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:jp.png|link={{{1}}}:jp|日本語]] }} | }}</mark> <!-- | ||
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;padding:2px;background:#3A3A3A;">[[File:cn.png|link=|简体中文]] [[Category:Simplified Chinese]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:cn.png|link={{{1}}}:zh-cn|简体中文]] }} | }}</mark> <!-- | ||
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;padding:2px;background:#3A3A3A;">[[File:tw.png|link=|简体中文]] [[Category:Taiwanese Mandarin]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:tw.png|link={{{1}}}:zh-tw|简体中文]] }} | }}</mark> <!-- | ||
Korean - ko | Korean - ko | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ko}}| {{#ifeq: {{{1}}}:ko | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:ko.png|link=|한국어]] [[Category:Korean]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:ko.png|link={{{1}}}:ko|한국어]] }} | }}</mark> <!-- | ||
Georgian - ka | Georgian - ka | ||
--> | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{1}}}:ka}}| {{#ifeq: {{{1}}}:ka | {{ARTICLEPAGENAME}} | <mark style="border:1px solid #65635F;padding:2px;background:#3A3A3A;">[[File:ka.png|link=|ქართული ენა]] [[Category:Georgian]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[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;padding:2px;background:#3A3A3A;">[[File:he.png|link=|עִברִית]] [[Category:Hebrew]] | <mark style="border:1px solid #65635F;padding:2px;background:#262626;">[[File:he.png|link={{{1}}}:he|עִברִית]] }} | }}</mark></div> |
Revision as of 14:58, 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.