• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:ISO 639 name

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
Shortcuts
  • {{Iso2langTemplate:Iso2lang}}
  • {{LangnameTemplate:Langname}}
  • {{LanguageTemplate:Language}}
  • {{LnameTemplate:Lname}}
  • {{LcodeTemplate:Lcode}}
This template may be substituted.
WarningThis template is used on approximately 27,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
This template uses Lua:
  • Module:ISO 639 name (sandbox)
Language templates
Language names (ISO 639)
  • {{ISO 639 name}}
Interwiki links
  • {{Wikt-lang}}
  • Module:Wikt-lang
  • Module:Wikt-lang/data
  • {{Interlanguage link}}
Foreign-language text
  • {{Lang}}
  • {{Langx}}
  • Module:Lang
  • {{Transliteration}}
  • {{Title language}}
Other
  • {{IPA}}
  • v
  • t
  • e

This template may be used to convert a language name (e.g. 'Spanish' or 'German') to an ISO 639 language code ('es' or 'de', respectively) and vice-versa, or to determine if a given code or language is valid in ISO 639.

Contents

  • 1 Usage
  • 2 Parameters
    • 2.1 Additional function values
  • 3 Language names and codes
  • 4 Examples
    • 4.1 One parameter
    • 4.2 With |fn=iso_639_name_to_code
  • 5 Notes
  • 6 Error messages
  • 7 Tracking categories
  • 8 See also

Usage

  • {{ISO 639 name|ISO code}}
  • {{ISO 639 name|fn=iso_639_code_to_name|ISO code}}
  • {{Iso 639 name|fn=iso_639_name_to_code|Language name}}
  • {{ISO 639 name|fn=iso_639|ISO code or language name|link=yes|hide-err=yes}}
  • {{iso 639 name|fn=iso_639_code_exists|ISO code}}

Parameters

There is one required parameter and four optional parameters:

  • |1= – unnamed (positional) param: either an ISO 639 language code, or an ISO 639 language name (required)
  • |fn= – function name: identifies what to do with the code or name in param 1 (convert it, check if it exists; etc.) (optional). These are the most commonly used values:
    • iso_639_code_to_name – convert the ISO 639 code in param 1 to a language name. (This is the default if fn is omitted.)
    • iso_639_name_to_code – convert the language name in param 1 to an ISO 639 code
    • iso_639_code_exists – return true if the value in param 1 is an ISO 639 code, otherwise empty
    • iso_639_name_exists – return true if the value in param 1 is an ISO 639 language name, otherwise empty
    • iso_639 – try to convert the value in param 1 from a language name to an ISO 639 code, and if that fails then try the other way (code to language)
    (For more values of |fn=, see § Additional function values below).
  • |link=yes – if a language name is returned, links it to the Wikipedia article about the language (optional, default=no)
  • |label=any string – if a language name is returned, and linked with |link=yes, then you can alter the link text by setting this param
  • |hide_err=yes – blocks the error message returned upon failure of any of the three conversion functions ( iso_639_code_to_name, iso_639_name_to_code, iso_639 ) (optional; default=no)

Additional function values

The following function values are also available for parameter |fn=:

  • iso_639_code_1_to_name – same as iso_639_code_to_name except constrained to the ISO 639-1 data table
  • iso_639_code_2_to_name – same as iso_639_code_to_name except constrained to the ISO 639-2 data table
  • iso_639_code_2B_to_name – same as iso_639_code_to_name except constrained to the ISO 639-2B data table
  • iso_639_code_3_to_name – same as iso_639_code_to_name except constrained to the ISO 639-3 data table
  • iso_639_code_5_to_name – same as iso_639_code_to_name except constrained to the ISO 639-5 data table

Language names and codes

For a list of language names and ISO-639 codes, see:

  • List of Wikipedias
  • Special:SiteMatrix
  • Lists of ISO 639 codes

Examples

One parameter

  • {{ISO 639 name|en}} → English
  • {{ISO 639 name|fr}} → French

With |fn=iso_639_name_to_code

  • {{ISO 639 name|English|fn=iso_639_name_to_code}} → en
  • {{ISO 639 name|French|fn=iso_639_name_to_code}} → fr

Notes

The {{ISO 639 name}} template will trim extraneous IETF language tags to just the ISO 639 code. E.g.: Sanskrit in Latin script, which IETF language tag is sa-Latn, renders as:

  • {{ISO 639 name|sa-Latn}} → Sanskrit error: sa-Latn is an IETF tag (help)

The error message can be suppressed with |hide-err=yes:

  • {{ISO 639 name|sa-Latn|hide-err=yes}} → Sanskrit

The rendered language name can be linked to the appropriate language article with |link=yes:

  • {{ISO 639 name|sa-Latn|hide-err=yes|link=yes}} → Sanskrit

When linking, an alternate link label can be provided with |label=<label text>:

  • {{ISO 639 name|sa-Latn|hide-err=yes|link=yes|label=sa-Latn}} → sa-Latn

The {{ISO 639 name link}} template is the same as {{ISO 639 name}} except that it presets |link=yes.

Both of these templates can be safely substituted.

Error messages

This template produces error messages. These messages are:

  • <code> is an IETF tag – IETF language tags are not ISO 639 language codes. When these tags are encountered, the template attempts to render the correct language and also emits this error message
  • ISO 639-<part> code is required – where <part> is 1, 2, 3, 5; template was called without the required language code
  • <code> is not an ISO 639-<part> code – <code> fails simple length validation; 639 part 1, language codes are two characters, for 639 parts 2, 3, and 5, language codes are three characters
  • <code> not found in ISO 639-<part> list – <code> not found after searching ISO 639-<part> data

The module that does the work for this template has other functionality not supported by this template. See Module:ISO 639 name. Error messages related to that other functionality are:

  • language name required – module function iso_639_name_to_code() only – this message emitted when a language name is not provided in the {{#invoke:}}
  • <part> not an ISO 639 part – module functions iso_639_name_to_code() and iso_639() only – this message emitted when <part> is not one of 1, 2, 3, or 5
  • language code or name required – module function iso_639() only – this message emitted when a language name or a language code is not provided in the {{#invoke:}}

Tracking categories

  • Category:ISO 639 name template errors (28)

See also

  • Category:Lang-x templates
  • Category:Lang-x templates with other than ISO 639
  • Category:Articles containing non-English-language text
  • {{lang}}
  • {{mw lang}}
  • {{language with name}}
The above documentation is transcluded from Template:ISO 639 name/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:ISO_639_name&oldid=975656063"
Last edited on 29 August 2020, at 18:26

Languages

    • Acèh
    • Afrikaans
    • ak:Nhwɛsode:Language
    • Алтай тил
    • Anarâškielâ
    • Аԥсшәа
    • العربية
    • ܐܪܡܝܐ
    • Arpetan
    • অসমীয়া
    • Asturianu
    • Avañe'ẽ
    • Авар
    • Azərbaycanca
    • تۆرکجه
    • Basa Bali
    • বাংলা
    • Banjar
    • 閩南語 / Bân-lâm-gí
    • Башҡортса
    • Беларуская
    • Беларуская (тарашкевіца)
    • भोजपुरी
    • Bikol Central
    • Català
    • Cebuano
    • Čeština
    • Chamoru
    • Chavacano de Zamboanga
    • Cymraeg
    • الدارجة
    • Эрзянь
    • Español
    • فارسی
    • Fiji Hindi
    • Føroyskt
    • Français
    • Gaelg
    • Galego
    • گیلکی
    • ગુજરાતી
    • गोंयची कोंकणी / Gõychi Konknni
    • 客家語 / Hak-kâ-ngî
    • 한국어
    • हिन्दी
    • Ilokano
    • Bahasa Indonesia
    • Ирон
    • IsiXhosa
    • Jawa
    • ಕನ್ನಡ
    • Kapampangan
    • ქართული
    • Kiswahili
    • Kurdî
    • Ladin
    • La .lojban.
    • Magyar
    • मैथिली
    • Македонски
    • മലയാളം
    • Malti
    • मराठी
    • مصرى
    • مازِرونی
    • Bahasa Melayu
    • ꯃꯤꯇꯩ ꯂꯣꯟ
    • Minangkabau
    • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
    • မြန်မာဘာသာ
    • नेपाली
    • नेपाल भाषा
    • 日本語
    • Нохчийн
    • ଓଡ଼ିଆ
    • Oʻzbekcha / ўзбекча
    • ਪੰਜਾਬੀ
    • پنجابی
    • پښتو
    • ភាសាខ្មែរ
    • Tok Pisin
    • Português
    • Română
    • Русский
    • संस्कृतम्
    • ᱥᱟᱱᱛᱟᱲᱤ
    • Scots
    • Shqip
    • සිංහල
    • Simple English
    • سنڌي
    • Slovenščina
    • Soomaaliga
    • کوردی
    • Српски / srpski
    • Sunda
    • Suomi
    • Svenska
    • Tagalog
    • தமிழ்
    • Татарча / tatarça
    • တႆး
    • తెలుగు
    • ไทย
    • ትግርኛ
    • Тоҷикӣ
    • ᏣᎳᎩ
    • Українська
    • اردو
    • Tiếng Việt
    • Winaray
    • 吴语
    • Yorùbá
    • 粵語
    • 中文
    • Batak Mandailing
    • Kadazandusun
    • ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
    • ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 29 August 2020, at 18:26 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop