Template:Lang: Difference between revisions
(you literally just broke half the pages on this site doing that. nice.) |
mNo edit summary |
||
Line 101: | Line 101: | ||
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:-33px;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;}}"><!-- | -->{{#if: {{{noborder|}}} | margin-top:5px;border:0; | border:1px solid #65635F;border-bottom:0;}}"><!-- | ||
English | |||
-->{{#ifexist: {{{1}}} | {{#ifeq: {{{1}}} | {{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:en.png|English|link={{{1}}}]]</mark> | [[File:en.png|English|link={{{1}}}]] }} | }} <!-- | |||
-- | |||
Catalan - ca | Catalan - ca | ||
-->{{#ifexist: {{{1}}}:ca | | -->{{#ifexist: {{{1}}}:ca | {{#ifeq: {{{1}}}:ca | {{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:ca.png|Català|link={{{1}}}:ca]]</mark> | [[File:ca.png|Català|link={{{1}}}:ca]] }} | }} <!-- | ||
Czech - cs | Czech - cs | ||
-->{{#ifexist: {{{1}}}:cs | | -->{{#ifexist: {{{1}}}:cs | {{#ifeq: {{{1}}}:cs|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:cs.png|Čeština|link={{{1}}}:cs]]</mark> | [[File:cs.png|Čeština|link={{{1}}}:cs]] }} | }} <!-- | ||
German - de | German - de | ||
-->{{#ifexist: {{{1}}}:de | | -->{{#ifexist: {{{1}}}:de | {{#ifeq: {{{1}}}:de|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:de.png|Deutsch|link={{{1}}}:de]]</mark> | [[File:de.png|Deutsch|link={{{1}}}:de]] }} | }}<!-- | ||
Spanish - es | Spanish - es | ||
-->{{#ifexist: {{{1}}}:es | | -->{{#ifexist: {{{1}}}:es | {{#ifeq: {{{1}}}:es|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:es.png|Español|link={{{1}}}:es]]</mark> | [[File:es.png|Español|link={{{1}}}:es]] }} | }}<!-- | ||
French - fr | French - fr | ||
-->{{#ifexist: {{{1}}}:fr | | -->{{#ifexist: {{{1}}}:fr | {{#ifeq: {{{1}}}:fr|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:fr.png|Français|link={{{1}}}:fr]]</mark> | [[File:fr.png|Français|link={{{1}}}:fr]] }} | }}<!-- | ||
Hungarian - hu | Hungarian - hu | ||
-->{{#ifexist: {{{1}}}:hu | | -->{{#ifexist: {{{1}}}:hu | {{#ifeq: {{{1}}}:hu|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:hu.png|Magyar|link={{{1}}}:hu]]</mark> | [[File:hu.png|Magyar|link={{{1}}}:hu]] }} | }}<!-- | ||
Italian - it | Italian - it | ||
-->{{#ifexist: {{{1}}}:it | | -->{{#ifexist: {{{1}}}:it | {{#ifeq: {{{1}}}:it|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:it.png|Italiano|link={{{1}}}:it]]</mark> | [[File:it.png|Italiano|link={{{1}}}:it]] }} | }}<!-- | ||
Dutch - nl | Dutch - nl | ||
-->{{#ifexist: {{{1}}}:nl | | -->{{#ifexist: {{{1}}}:nl | {{#ifeq: {{{1}}}:nl|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:nl.png|Nederlands|link={{{1}}}:nl]]</mark> | [[File:nl.png|Nederlands|link={{{1}}}:nl]] }} | }}<!-- | ||
Norwegian - no | Norwegian - no | ||
-->{{#ifexist: {{{1}}}:no | | -->{{#ifexist: {{{1}}}:no | {{#ifeq: {{{1}}}:no|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:no.png|Norsk|link={{{1}}}:no]]</mark> | [[File:no.png|Norsk|link={{{1}}}:no]] }} | }}<!-- | ||
Polish - pl | Polish - pl | ||
-->{{#ifexist: {{{1}}}:pl | | -->{{#ifexist: {{{1}}}:pl | {{#ifeq: {{{1}}}:pl|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:pl.png|Polski|link={{{1}}}:pl]]</mark> | [[File:pl.png|Polski|link={{{1}}}:pl]] }} | }}<!-- | ||
Portuguese - pt | Portuguese - pt | ||
-->{{#ifexist: {{{1}}}:pt | | -->{{#ifexist: {{{1}}}:pt | {{#ifeq: {{{1}}}:pt|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:pt.png|Português|link={{{1}}}:pt]]</mark> | [[File:pt.png|Português|link={{{1}}}:pt]] }} | }}<!-- | ||
Brazilian Portuguese - pt-br | Brazilian Portuguese - pt-br | ||
-->{{#ifexist: {{{1}}}:pt-br | | -->{{#ifexist: {{{1}}}:pt-br | {{#ifeq: {{{1}}}:pt-br|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:pt-br.png|Português-Brasileiro|link={{{1}}}:pt-br]]</mark> | [[File:pt-br.png|Português-Brasileiro|link={{{1}}}:pt-br]] }} | }}<!-- | ||
Russian - ru | Russian - ru | ||
-->{{#ifexist: {{{1}}}:ru | | -->{{#ifexist: {{{1}}}:ru | {{#ifeq: {{{1}}}:ru|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:ru.png|Русский|link={{{1}}}:ru]]</mark> | [[File:ru.png|Русский|link={{{1}}}:ru]] }} | }}<!-- | ||
Ukrainian - ua | Ukrainian - ua | ||
-->{{#ifexist: {{{1}}}:ua | | -->{{#ifexist: {{{1}}}:ua | {{#ifeq: {{{1}}}:ua|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:ua.png|Українська|link={{{1}}}:ua]]</mark> | [[File:ua.png|Українська|link={{{1}}}:ua]] }} | }}<!-- | ||
Swedish - sv | Swedish - sv | ||
-->{{#ifexist: {{{1}}}:sv | | -->{{#ifexist: {{{1}}}:sv | {{#ifeq: {{{1}}}:sv | {{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:sv.png|Svenska|link={{{1}}}:sv]]</mark> | [[File:sv.png|Svenska|link={{{1}}}:sv]] }} | }}<!-- | ||
Turkish - tr | Turkish - tr | ||
-->{{#ifexist: {{{1}}}:tr | | -->{{#ifexist: {{{1}}}:tr | {{#ifeq: {{{1}}}:tr|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:tr.png|Türkçe|link={{{1}}}:tr]]</mark> | [[File:tr.png|Türkçe|link={{{1}}}:tr]] }} | }}<!-- | ||
Japanese - jp | Japanese - jp | ||
-->{{#ifexist: {{{1}}}:jp | | -->{{#ifexist: {{{1}}}:jp | {{#ifeq: {{{1}}}:jp|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:jp.png|日本語|link={{{1}}}:jp]]</mark> | [[File:jp.png|日本語|link={{{1}}}:jp]] }} | }}<!-- | ||
Simplified Chinese - zh-cn | Simplified Chinese - zh-cn | ||
-->{{#ifexist: {{{1}}}:zh-cn | | -->{{#ifexist: {{{1}}}:zh-cn | {{#ifeq: {{{1}}}:zh-cn|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:cn.png|简体中文|link={{{1}}}:zh-cn]]</mark> | [[File:cn.png|简体中文|link={{{1}}}:zh-cn]] }} | }}<!-- | ||
Taiwanese Mandarin - zh-tw | Taiwanese Mandarin - zh-tw | ||
-->{{#ifexist: {{{1}}}:zh-tw | | -->{{#ifexist: {{{1}}}:zh-tw | {{#ifeq: {{{1}}}:zh-tw|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:tw.png|简体中文|link={{{1}}}:zh-tw]]</mark> | [[File:tw.png|简体中文|link={{{1}}}:zh-tw]] }} | }}<!-- | ||
Korean - ko | Korean - ko | ||
-->{{#ifexist: {{{1}}}:ko | | -->{{#ifexist: {{{1}}}:ko | {{#ifeq: {{{1}}}:ko|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:ko.png|한국어|link={{{1}}}:ko]]</mark> | [[File:ko.png|한국어|link={{{1}}}:ko]] }} | }}<!-- | ||
Georgian - ka | Georgian - ka | ||
-->{{#ifexist: {{{1}}}:ka | | -->{{#ifexist: {{{1}}}:ka | {{#ifeq: {{{1}}}:ka|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:ka.png|ქართული ენა|link={{{1}}}:ka]]</mark> | [[File:ka.png|ქართული ენა|link={{{1}}}:ka]] }} | }}<!-- | ||
Hebrew - he | Hebrew - he | ||
-->{{#ifexist: {{{1}}}:he | | -->{{#ifexist: {{{1}}}:he | {{#ifeq: {{{1}}}:he|{{ARTICLEPAGENAME}} | <mark style="background:#3A3A3A;border:1px solid #65635F;">[[File:he.png|עִברִית|link={{{1}}}:he]]</mark> | [[File:he.png|עִברִית|link={{{1}}}:he]] }} | }}</div> | ||
Revision as of 10:09, 1 May 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 noborder
parameter can be set to 1
to hide the border around 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 |noborder=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 icon borders.
Currently supported languages:
For information on how the template detects other languages, view this page's source code.