Difference between revisions of "Template:Otherlang"

From Tycoon Gaming
m (making code more readable)
 
(61 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template adds available translations for the page to the top through the use of flags.
+
 
 +
This template adds all available translations for the page to the top through the use of flags.
  
 
To prevent issues, this template must be placed '''at the very beginning of a page'''.
 
To prevent issues, this template must be placed '''at the very beginning of a page'''.
 
Tip! When contributing a new translation to a document that already has other translations, please carry over the existing translations to the otherlang template of your contributed page. This way all multilingual pages are linked.
 
  
 
== Syntax ==
 
== Syntax ==
 
<pre>
 
<pre>
  {{otherlang
+
{{otherlang
  | noborder=true (OPTIONAL)
+
| noborder=true (OPTIONAL)
  | title=localized page display title
+
| en=PageName
  | lang=page:lang
+
| title=Alternative Title
  | lang2=page:lang2
+
}}
  | etc...
 
  }}
 
</pre>
 
 
 
Warning! Do not include the language of the current page. This will only confuse readers.
 
 
 
=== Example ===
 
On a page called [[Test]]:
 
 
 
<pre>
 
  {{otherlang
 
  | title=Test
 
  | de=Test:de
 
  }}
 
 
</pre>
 
</pre>
 
+
<!--
Note that:
+
'''Warning: Do not include the language of the current page. This will only confuse readers.'''
* The language "en" is not included, as it is the language of the page that template is being used on.
+
-->
* title is assigned the translated name of the page, and will appear as the display title (heading) for the page. This can replace the existing {{wrongtitle}} and {{DISPLAYTITLE}} templates currently in common use.
 
* The English page has no suffix.
 
* The same template must be used on the translated page (with the other language) to link back
 
 
 
 
== Available Languages ==
 
== Available Languages ==
{| class="table table-bordered" border="2" cellpadding="7"
+
{| class="article-table"
! Language
+
! style="width: 48%" | Language
! Syntax
+
! style="width: 48%" | Syntax
! Result
+
! style="width: 4%" | Flag
 
|- id="en"
 
|- id="en"
 
|English
 
|English
 
|en=Page_name
 
|en=Page_name
|English
+
|[[File:En.png]]
 +
|- id="nl"
 +
|Dutch
 +
|nl=NL:Page_name
 +
|[[File:nl.png]]
 +
|- id="fr"
 +
|French
 +
|fr=FR:Page_name
 +
|[[File:Fr.png]]
 
|- id="de"
 
|- id="de"
|Deutsch
 
|de=de:Page_name
 
 
|German
 
|German
 +
|de=DE:Page_name
 +
|[[File:De.png]]
 +
|- id="it"
 +
|Italian
 +
|it=IT:Page_name
 +
|[[File:It.png]]
 
|- id="pl"
 
|- id="pl"
|Polski
 
|pl=pl:Page_name
 
 
|Polish
 
|Polish
 +
|pl=PL:Page_name
 +
|[[File:Pl.png]]
 
|- id="es"
 
|- id="es"
|Éspanol
 
|es=es:Page_name
 
 
|Spanish
 
|Spanish
|- id="fr"
+
|es=ES:Page_name
|Français
+
|[[File:Es.png]]
|fr=fr:Page_name
+
|- id="ro"
|French
+
|Romanian
 +
|ro=RO:Page_name
 +
|[[File:Ro.png]]
 +
|- id="pt"
 +
|Portuguese
 +
|pt=PT:Page_name
 +
|[[File:Pt.png]]
 +
|- id="pt-br"
 +
|Brazilian Portuguese
 +
|pt-br=PT-BR:Page_name
 +
|[[File:Pt-br.png]]
 +
|- id="tr"
 +
|Turkish
 +
|tr=TR:Page_name
 +
|[[File:Tr.png]]
 +
|- id="ar"
 +
|Arabic
 +
|ar=AR:Page_name
 +
|[[File:Ar.png]]
 +
|- id="dk"
 +
|Danish
 +
|dk=DK:Page_name
 +
|[[File:Dk.png]]
 +
|- id="cs"
 +
|Czech
 +
|cs=CS:Page_name
 +
|[[File:Cs.png]]
 +
|- id="ru"
 +
|Russian
 +
|ru=RU:Page_name
 +
|[[File:Ru.png]]
 +
|- id="hu"
 +
|Hungarian
 +
|hu=HU:Page_name
 +
|[[File:Hu.png]]
 +
|- id="sk"
 +
|Slovak
 +
|sk=SK:Page_name
 +
|[[File:Sk.png]]
 +
|- id="zh-cn"
 +
|Chinese (Simplified)
 +
|zh-cn=ZH-CN:Page_name
 +
|[[File:Zh-cn.png]]
 +
|- id="ee"
 +
|Estonian
 +
|ee=EE:Page_name
 +
|[[File:Ee.png]]
 +
|- id="id"
 +
|Indonesian
 +
|id=ID:Page_name
 +
|[[File:Id.png]]
 +
|- id="ID"
 +
|Latvian
 +
|lv=LV:Page_name
 +
|[[File:Lv.png]]
 +
|- id="hi"
 +
|Hindi
 +
|hi=HI:Page_name
 +
|[[File:Hi.png]]
 +
|- id="bg"
 +
|Bulgarian
 +
|bg=BG:Page_name
 +
|[[File:Bg.png]]
 +
|- id="cy"
 +
|Welsh
 +
|cy=CY:Page_name
 +
|[[File:Cy.png]]
 +
|- id="ja"
 +
|Japanese
 +
|ja=JA:Page_name
 +
|[[File:Ja.png]]
 +
|- id="kr"
 +
|Korean
 +
|kr=KR:Page_name
 +
|[[File:Kr.png]]
 
|}
 
|}
 +
<!-- Waiting for Variables Extension-->
 +
 
</noinclude>
 
</noinclude>
{{#if:{{{en|}}}|'''[[English|{{{en}}}]'''}}{{#if:{{{de|}}}|'''[[German|{{{de}}}]'''}}{{#if:{{{pl|}}}|'''[[Polish|{{{pl}}}]'''}}{{#if:{{{es|}}}|'''[[Spanish|{{{es}}}]'''}}{{#if:{{{fr|}}}|'''[[French|{{{fr}}}]'''}}
+
{{#vardefine: realBasePageName | {{#if: {{{en|}}} | {{{en}}} | {{PAGENAME}} }} }} {{
 +
#if: {{{title|}}} | {{DISPLAYTITLE:{{{title}}}}} }}<div style="
 +
    display: flex;
 +
    flex-direction: row;
 +
    gap: 2px;
 +
    position: relative;
 +
    top: -20px;
 +
    margin-bottom: -40px;
 +
    float: right;
 +
    text-align: right;
 +
    padding: 2px;
 +
    line-height: 11px;
 +
    background: #262626;
 +
    border: 0;"> {{
 +
#ifexist: {{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|{{#var:realBasePageName}}| | [[File:En.png|alt=English|link={{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: DE:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|DE:{{#var:realBasePageName}}| | [[File:De.png|alt=German|link=DE:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: ES:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|ES:{{#var:realBasePageName}}| | [[File:Es.png|alt=Spanish|link=ES:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: FR:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|FR:{{#var:realBasePageName}}| | [[File:Fr.png|alt=French|link=FR:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: IT:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|IT:{{#var:realBasePageName}}| | [[File:It.png|alt=Italian|link=IT:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: NL:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|NL:{{#var:realBasePageName}}| | [[File:Nl.png|alt=Dutch|link=NL:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: PL:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|PL:{{#var:realBasePageName}}| | [[File:Pl.png|alt=Polish|link=PL:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: RO:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|RO:{{#var:realBasePageName}}| | [[File:Ro.png|alt=Romanian|link=RO:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: PT:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|PT:{{#var:realBasePageName}}| | [[File:Pt.png|alt=Portuguese|link=PT:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: PT-BR:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|PT-BR:{{{#var:realBasePageName}}| | [[File:Pt-br.png|alt=Brazilian Portuguese|link=PT-BR:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: TR:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|TR:{{#var:realBasePageName}}| | [[File:Tr.png|alt=Turkish|link=TR:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: AR:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|AR:{{#var:realBasePageName}}| | [[File:Ar.png|alt=Arabic|link=AR:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: DK:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|DK:{{#var:realBasePageName}}| | [[File:Dk.png|alt=Danish|link=DK:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: CS:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|CS:{{#var:realBasePageName}}| | [[File:Cs.png|alt=Czech|link=CS:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: RU:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|RU:{{#var:realBasePageName}}| | [[File:Ru.png|alt=Russian|link=RU:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: HU:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|HU:{{#var:realBasePageName}}| | [[File:Hu.png|alt=Hungarian|link=HU:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: SK:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|SK:{{#var:realBasePageName}}| | [[File:Sk.png|alt=Slovak|link=SK:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: ZH-CN:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|ZH-CN:{{#var:realBasePageName}}| | [[File:Zh-cn.png|alt=Chinese (Simplified)|link=ZH-CN:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: EE:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|EE:{{#var:realBasePageName}}| | [[File:Ee.png|alt=Estonian|link=EE:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: ID:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|ID:{{#var:realBasePageName}}| | [[File:Id.png|alt=Indonesian|link=ID:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: LV:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|LV:{{#var:realBasePageName}}| | [[File:Lv.png|alt=Latvian|link=LV:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: HI:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|HI:{{#var:realBasePageName}}| | [[File:Hi.png|alt=Hindi|link=HI:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: BG:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|BG:{{#var:realBasePageName}}| | [[File:Bg.png|alt=Bulgarian|link=BG:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: CY:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|CY:{{#var:realBasePageName}}| | [[File:Cy.png|alt=Welsh|link=CY:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: JA:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|JA:{{#var:realBasePageName}}| | [[File:Ja.png|alt=Japanese|link=JA:{{#var:realBasePageName}}]] }} }} {{
 +
#ifexist: KR:{{#var:realBasePageName}} | {{#ifeq: {{PAGENAME}}|HR:{{#var:realBasePageName}}| | [[File:Kr.png|alt=Korean|link=KR:{{#var:realBasePageName}}]] }} }}</div>
 +
<!--
 +
{{#if: {{{title|}}} | {{DISPLAYTITLE:{{{title}}}}} }}<div style="position:relative;top:-32px;margin-bottom: -40px;float:right;text-align:right;padding:2px;line-height:11px;background:#262626;
 +
{{#if: {{{noborder|}}} | margin-top:5px;border:0; | border:1px solid #65635F;border-bottom:0;}}">
 +
{{
 +
#if: {{{en|}}} | '''[[File:En.png|alt=English|link={{#var:realBasePageName}}]]''' }} {{
 +
#if: {{{de|}}} | [[File:De.png|alt=Deutsch|link={{{de}}}]] }} {{
 +
#if: {{{es|}}} | [[File:Es.png|alt=Español|link={{{es}}}]] }} {{
 +
#if: {{{fr|}}} | [[File:Fr.png|alt=Français|link={{{fr}}}]] }} {{
 +
#if: {{{it|}}} | [[File:It.png|alt=Italiano|link={{{it}}}]] }} {{
 +
#if: {{{nl|}}} | [[File:Nl.png|alt=Nederlands|link={{{nl}}}]] }} {{
 +
#if: {{{pl|}}} | [[File:Pl.png|alt=Polski|link={{{pl}}}]] }} {{
 +
#if: {{{ro|}}} | [[File:Ro.png|alt=Romanian|link={{{ro}}}]] }} {{
 +
#if: {{{pt|}}} | [[File:Pt.png|alt=Portuguese|link={{{pt}}}]] }} {{
 +
#if: {{{pt-br|}}} | [[File:Pt-br.png|alt=Portuguese|link={{{pt-br}}}]] }} {{
 +
#if: {{{tr|}}} | [[File:Tr.png|alt=Turkish|link={{{tr}}}]] }} {{
 +
#if: {{{ar|}}} | [[File:Ar.png|alt=Arabic|link={{{ar}}}]] }} {{
 +
#if: {{{dk|}}} | [[File:Dk.png|alt=Danish|link={{{dk}}}]] }} {{
 +
#if: {{{cs|}}} | [[File:Cs.png|alt=Czech|link={{{cs}}}]] }} {{
 +
#if: {{{ru|}}} | [[File:Ru.png|alt=Russian|link={{{ru}}}]] }} {{
 +
#if: {{{hu|}}} | [[File:Hu.png|alt=Hungarian|link={{{hu}}}]] }} {{
 +
#if: {{{sk|}}} | [[File:Sk.png|alt=Slovak|link={{{sk}}}]] }} {{
 +
#if: {{{zh-cn|}}} | [[File:Zh-cn.png|alt=Chinese (Simplified)|link={{{zh-cn}}}]] }} {{
 +
#if: {{{ee|}}} | [[File:Ee.png|alt=Estonian|link={{{ee}}}]] }} {{
 +
#if: {{{id|}}} | [[File:Id.png|alt=Indonesian|link={{{id}}}]] }} {{
 +
#if: {{{lv|}}} | [[File:Lv.png|alt=Latvian|link={{{lv}}}]] }} {{
 +
#if: {{{hi|}}} | [[File:Hi.png|alt=Hindi|link={{{hi}}}]] }} {{
 +
#if: {{{bg|}}} | [[File:Bg.png|alt=Bulgarian|link={{{bg}}}]] }} {{
 +
#if: {{{cy|}}} | [[File:Cy.png|alt=Welsh|link={{{cy}}}]] }} {{
 +
#if: {{{ja|}}} | [[File:Ja.png|alt=Japanese|link={{{ja}}}]] }} {{
 +
#if: {{{kr|}}} | [[File:Kr.png|alt=Korean|link={{{kr}}}]] }}</div>
 +
-->

Latest revision as of 02:14, 13 January 2024


This template adds all available translations for the page to the top through the use of flags.

To prevent issues, this template must be placed at the very beginning of a page.

Syntax

{{otherlang
| noborder=true (OPTIONAL)
| en=PageName
| title=Alternative Title
}}

Available Languages

Language Syntax Flag
English en=Page_name En.png
Dutch nl=NL:Page_name Nl.png
French fr=FR:Page_name Fr.png
German de=DE:Page_name De.png
Italian it=IT:Page_name It.png
Polish pl=PL:Page_name Pl.png
Spanish es=ES:Page_name Es.png
Romanian ro=RO:Page_name Ro.png
Portuguese pt=PT:Page_name Pt.png
Brazilian Portuguese pt-br=PT-BR:Page_name Pt-br.png
Turkish tr=TR:Page_name Tr.png
Arabic ar=AR:Page_name Ar.png
Danish dk=DK:Page_name Dk.png
Czech cs=CS:Page_name Cs.png
Russian ru=RU:Page_name Ru.png
Hungarian hu=HU:Page_name Hu.png
Slovak sk=SK:Page_name Sk.png
Chinese (Simplified) zh-cn=ZH-CN:Page_name Zh-cn.png
Estonian ee=EE:Page_name Ee.png
Indonesian id=ID:Page_name Id.png
Latvian lv=LV:Page_name Lv.png
Hindi hi=HI:Page_name Hi.png
Bulgarian bg=BG:Page_name Bg.png
Welsh cy=CY:Page_name Cy.png
Japanese ja=JA:Page_name Ja.png
Korean kr=KR:Page_name Kr.png


Spanish