Terraria Wiki
Terraria Wiki
m ({{langList}} should really be the only location to store the list of languages. Hence, {{lang}} must not be included here as it causes a template loop. Also see User talk:Rye Greenwood.)
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#if:{{#dplvar:_langlist-loaded}}||{{#dplvar:set|_langlist-loaded|y<!--
 
<includeonly>{{#if:{{#dplvar:_langlist-loaded}}||{{#dplvar:set|_langlist-loaded|y<!--
  +
 
//list: onWiki and offWiki (different suffix for all {{lang|}})
 
-->|_langlist_onWiki_|bg, cs, da, el, fi, id, it, ja, lt, lv, nl, no, ro, sk, sv, th, tr, vi, yue<!--
 
-->|_langlist_offWiki_|de, es, fr, hu, ko, ru, pl, pt, uk, zh<!--
   
 
//Languages on the English wiki
 
//Languages on the English wiki
Line 6: Line 10:
 
-->|_langlist_da|on<!-- Danish
 
-->|_langlist_da|on<!-- Danish
 
-->|_langlist_el|on<!-- Greek
 
-->|_langlist_el|on<!-- Greek
-->|_langlist_es|on<!-- Spanish
 
 
-->|_langlist_fi|on<!-- Finnish
 
-->|_langlist_fi|on<!-- Finnish
 
-->|_langlist_id|on<!-- Indonesian
 
-->|_langlist_id|on<!-- Indonesian
Line 25: Line 28:
 
//Languages with an own subdomain
 
//Languages with an own subdomain
 
-->|_langlist_de|off<!-- German
 
-->|_langlist_de|off<!-- German
 
-->|_langlist_es|off<!-- Spanish
 
-->|_langlist_fr|off<!-- French
 
-->|_langlist_fr|off<!-- French
 
-->|_langlist_hu|off<!-- Hungarian
 
-->|_langlist_hu|off<!-- Hungarian
Line 47: Line 51:
 
-->|_langlist_isEn_|yes<!--
 
-->|_langlist_isEn_|yes<!--
   
  +
-->}}{{#dplvar:set|<!--
//list: onWiki and offWiki (different suffix for all {{lang|}})
 
  +
-->|_langlist_onWiki_on|{{#dplvar:_langlist_onWiki_}}<!--
-->|_langlist_onWiki_|bg, cs, da, el, es, fi, id, it, ja, lt, lv, nl, no, ro, sk, sv, th, tr, vi, yue<!--
 
 
-->|_langlist_offWiki_on|{{#dplvar:_langlist_offWiki_}}<!--
-->|_langlist_offWiki_|de, fr, hu, ko, ru, pl, pt, uk, zh<!--
 
  +
-->|_langlist_onWiki_off|{{#dplvar:_langlist_onWiki_}}<!--
-->|_langlist_onWiki_on|bg, cs, da, el, es, fi, id, it, ja, lt, lv, nl, no, ro, sk, sv, th, tr, vi, yue<!--
 
 
-->|_langlist_offWiki_off|{{#dplvar:_langlist_offWiki_}}<!--
-->|_langlist_offWiki_on|de, fr, hu, ko, ru, pl, pt, uk, zh<!--
 
-->|_langlist_onWiki_off|bg, cs, da, el, es, fi, id, it, ja, lt, lv, nl, no, ro, sk, sv, th, tr, vi, yue<!--
 
-->|_langlist_offWiki_off|de, fr, hu, ko, ru, pl, pt, uk, zh<!--
 
 
   
 
-->}}<!-- end #dplvar -->}}<!-- end #if
 
-->}}<!-- end #dplvar -->}}<!-- end #if
 
   
 
query for result:
 
query for result:

Revision as of 17:32, 17 June 2021

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 language projects that are ongoing, i.e. still on this wiki, and one with all completed language 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

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}} bg, cs, da, el, fi, id, it, ja, lt, lv, nl, no, ro, sk, sv, th, tr, vi, yue
{{langList|offWiki}} de, es, fr, hu, ko, ru, pl, pt, uk, zh
{{#lstsep:{{langList|offWiki}}|,|*}} de*es*fr*hu*ko*ru*pl*pt*uk*zh