Template:LangList

From Terraria Wiki
Jump to navigation Jump to search
Template-info.svg Documentation The documentation below is transcluded from Template:LangList/doc. (edit | history)

This template stores two lists of language codes: One with all translation projects that are ongoing, i.e. still on this wiki, and one with all completed translation projects, i.e. languages with an own subdomain. In some i18n contexts, this information is relevant, e.g. the interwiki linking functionality of {{translation projects}}.

Usage

{{ langList | <function> | <target lang> }}

First unnamed parameter

One of the following functions:

isOnWiki Returns yes if the <target lang> is the language code of an ongoing project.
isOffWiki Returns yes if the <target lang> is the language code of a completed project.
isEn Returns yes if the <target lang> is neither on-wiki nor off-wiki, i.e. English.
onWiki Lists all languages for which isOnWiki is true. See Extension:ParserPower for parser functions for handling this list.
offWiki Lists all languages for which isOffWiki is true.
Second unnamed parameter

The ISO 639-1 (or ISO 639-3) code of the language to operate on; is usually set to {{lang}}. Has no effect if the first unnamed parameter is set to onWiki or offWiki, and can be omitted in those cases.

Examples

Code Result
{{langList|isOffWiki|cs}}
{{langList|isOffWiki|zh}} yes
{{langList|isOffWiki|en}}
{{langList|isOnWiki|cs}} yes
{{langList|isOnWiki|zh}}
{{langList|isOnWiki|en}}
{{langList|isEn|en}} yes
{{langList|isEn|it}}
{{langList|isEn|zh}}
{{langList|onWiki}} ar, bg, cs, da, el, es, fi, hi, id, it, ja, lt, lv, nl, no, ro, sk, sv, th, tr, vi, yue
{{langList|offWiki}} de, fr, hu, ko, ru, pl, pt, uk, zh, es-formal
{{#lstsep:{{langList|offWiki}}|,|__}} de__fr__hu__ko__ru__pl__pt__uk__zh__es-formal
{{#lstmap:{{#listsort:list={{langList|onWiki}}|insep=,|token=@@|pattern=<esc>{{langInfo|@@|name}}</esc>|sortoptions=alpha}}|,|@@|<esc>[[Terraria Wiki:Projects/{{langInfo|@@|name}} translation|{{langInfo|@@|name}} (@@)]]</esc>}} Arabic (ar), Bulgarian (bg), Cantonese (yue), Czech (cs), Danish (da), Dutch (nl), Finnish (fi), Greek (el), Hindi (hi), Indonesian (id), Italian (it), Japanese (ja), Latvian (lv), Lithuanian (lt), Norwegian (no), Romanian (ro), Slovak (sk), Spanish (es), Swedish (sv), Thai (th), Turkish (tr), Vietnamese (vi)