- Description
- Provides a simple method to create a plain list of native language names from language codes. The list items can either be provided as individual arguments, or loaded from a JavaScript, JSON, or Lua page on the wiki. Invokes Module:Language list.
- This template uses the semantically-correct
<ul>element, as opposed to creating line breaks with<br>. - Categories
- The "Translated scripts/Language" category is added for each recognised language code given as a parameter. To disable this, add the
nocat=parameter. - Syntax - default mode
- Add the language codes to be listed as anonymous parameters to the template.
- If there are five or more languages, the list will be collapsed by default. To have the list always collapse, add the
collapse=yesparameter, or to have the list never collapse, add thecollapse=noparameter. - For scripts where translations are kept in separate pages and these pages should be linked, add the
linkparameter (example:link=MediaWiki:CategoryRenameAuto-update/$1.js).$1will be replaced with the language code. Links for a specific language can be added by using the language code as the parameter and the link target as its value (example:fr=w:c:fr:Aide:UserTags). - Sample output - default mode
{{Language list|collapse=yes|de|en|es|fr|it|ja|nl|pl|ru|zh}}gives...- Deutsch (de)
- English (en)
- español (es)
- français (fr)
- italiano (it)
- 日本語 (ja)
- Nederlands (nl)
- polski (pl)
- русский (ru)
- 中文 (zh)
- Syntax - automatic JavaScript mode
- The template can create a language list directly from a JavaScript page. Add the
source-jsparameter, with the source JavaScript page title as its value. - This mode requires that two
// language list ...delimiters are added to the JavaScript page surrounding the object that contains translations. Indentation used for the starting delimiter and every language key must be identical. See below:
(function () {
//...other code
var translations = {
// language list - start
en: {
loading: "Loading…"
},
ru: {
loading: "Загрузка…"
}
// language list - stop
};
//...other code
}());
- Sample output - automatic JavaScript mode
{{Language list|source-js=Template:Language list/doc}}gives...- English (en)
- русский (ru)
- Syntax - automatic JSON mode
- The template can create a language list directly from the object keys on a JSON page. Add the
source-jsonparameter, with the source JSON page title as its value. - Sample output - automatic JSON mode
{{Language list|source-json=MediaWiki:Custom-I18n-js/i18n.json}}gives...- English (en)
- العربية (ar)
- беларуская (be)
- Deutsch (de)
- Ελληνικά (el)
- español (es)
- eesti (et)
- français (fr)
- português do Brasil (pt-br)
- русский (ru)
- Türkçe (tr)
- українська (uk)
- 中文(简体) (zh-hans)
- 中文(繁體) (zh-hant)
- Syntax - automatic Lua mode
- The template can create a language list directly from the table keys of a Lua module data page. Add the
source-luaparameter, with the source Lua page title as its value. - Sample output - automatic Lua mode
{{Language list|source-lua=Module:Common/i18n}}gives...- العربية (ar)
- беларуская (be)
- বাংলা (bn)
- català (ca)
- corsu (co)
- Deutsch (de)
- Ελληνικά (el)
- English (en)
- español (es)
- eesti (et)
- suomi (fi)
- français (fr)
- עברית (he)
- हिन्दी (hi)
- hrvatski (hr)
- Bahasa Indonesia (id)
- italiano (it)
- 日本語 (ja)
- ქართული (ka)
- 한국어 (ko)
- latviešu (lv)
- молдовеняскэ (mo)
- Nederlands (nl)
- polski (pl)
- português (pt)
- português do Brasil (pt-br)
- русский (ru)
- српски / srpski (sr)
- српски (ћирилица) (sr-ec)
- srpski (latinica) (sr-el)
- Tagalog (tl)
- Türkçe (tr)
- українська (uk)
- Tiếng Việt (vi)
- 中文(简体) (zh-hans)
- 中文(繁體) (zh-hant)