FANDOM


    Template documentation
    Note: parts of or entire template might not be visible without values provided.
    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=yes parameter, or to have the list never collapse, add the collapse=no parameter.
    For scripts where translations are kept in separate pages and these pages should be linked, add the link parameter (example: link=MediaWiki:CategoryRenameAuto-update/$1.js). $1 will 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-js parameter, 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-json parameter, 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)
    • Ελληνικά (el)
    • Español (es)
    • Русский (ru)
    • Українська (uk)
    • ‪中文(简体)‬ (zh-hans)
    • ‪中文(繁體)‬ (zh-hant)
    • ‪中文(香港)‬ (zh-hk)
    • ‪中文(台灣)‬ (zh-tw)
    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-lua parameter, with the source Lua page title as its value.
    Sample output - automatic Lua mode
    {{Language list|source-lua=Module:Common/i18n}} gives...
    • Беларуская (be)
    • বাংলা (bn)
    • Deutsch (de)
    • Ελληνικά (el)
    • English (en)
    • Español (es)
    • Français (fr)
    • हिन्दी (hi)
    • Bahasa Indonesia (id)
    • Italiano (it)
    • 日本語 (ja)
    • 한국어 (ko)
    • Nederlands (nl)
    • Polski (pl)
    • Português (pt)
    • Português do Brasil (pt-br)
    • Русский (ru)
    • Türkçe (tr)
    • Українська (uk)
    • Tiếng Việt (vi)
    • ‪中文(简体)‬ (zh-hans)
    • ‪中文(繁體)‬ (zh-hant)
    Text above can be found here (edit)
    Community content is available under CC-BY-SA unless otherwise noted.

    Fandom may earn an affiliate commission on sales made from links on this page.

    Stream the best stories.

    Fandom may earn an affiliate commission on sales made from links on this page.

    Get Disney+