![]() | This Lua module is used on approximately 32,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
Module:ISO 639 name implements:
{{ISO 639 name}}
{{Lang2iso}}
For code-to-name mapping, this module uses data from:
For name-to-code mapping, this module uses data from:
Returns true
when <code>
is found in one of the ISO 639-1, -2, -3, -5, or override tables; returns nil else.
Useage:
{{#invoke:ISO 639 name|iso_639_code_exists|<code>}}
Examples:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_exists}}
→<code>
:
{{#invoke:ISO 639 name|iso_639_code_exists|nav}}
→ true<code>
:
{{#invoke:ISO 639 name|iso_639_code_exists|xx}}
→Returns language name associated with <code>
. May return an error message with or without a language name.
Optional parameters:
|hide-err=yes
: suppresses error messages|link=yes
: creates link to en.wiki article about the language
|label=<label text>
– requires |link=yes
; label for the language-name link: [[<language name> language|<label text>]]
|raw=yes
: queries part tables only; returns language name as defined in the base data tables without the removal of disambiguation informationExamples:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_to_name}}
→ error: ISO 639 code is required (help)<code>
:
{{#invoke:ISO 639 name|iso_639_code_to_name|nav}}
→ Navajo<code>
:
{{#invoke:ISO 639 name|iso_639_code_to_name|xx}}
→ error: xx not found in ISO 639-1, -2, -2B, -3, -5 list (help)<code>
(IETF language tag):
{{#invoke:ISO 639 name|iso_639_code_to_name|nv-Latn}}
→ Navajo error: nv-Latn is an IETF tag (help)<code>
, error message suppressed:
{{#invoke:ISO 639 name|iso_639_code_to_name|nv-Latn|hide-err=yes}}
→ Navajo{{#invoke:ISO 639 name|iso_639_code_to_name|nav|link=yes}}
→ Navajo{{#invoke:ISO 639 name|iso_639_code_to_name|nav|link=yes|label=Navaho}}
→ Navahoel
is normally overridden by a setting in Module:ISO 639 name/ISO_639_override:
{{#invoke:ISO 639 name|iso_639_code_to_name|el}}
→ Greekel
with override suppressed:
{{#invoke:ISO 639 name|iso_639_code_to_name|el|raw=yes}}
→ Modern Greek (1453-)ina
name has disambiguation that is normally suppressed:
{{#invoke:ISO 639 name|iso_639_code_to_name|ina}}
→ Interlinguaina
with disambiguation:
{{#invoke:ISO 639 name|iso_639_code_to_name|ina|raw=yes}}
→ Interlingua (International Auxiliary Language Association)Same as iso_639_code_to_name
except that <code>
must be an ISO 639-1 code; search is constrained to Module:ISO 639 name/ISO 639 override and Module:ISO 639 name/ISO 639-1.
Example:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_1_to_name|nv}}
→ Navajo<code>
:
{{#invoke:ISO 639 name|iso_639_code_1_to_name|xx}}
→ error: xx not found in ISO 639-1 list (help)Same as iso_639_code_to_name
except that <code>
must be an ISO 639-2 code; search is constrained to Module:ISO 639 name/ISO 639 override and Module:ISO 639 name/ISO 639-2.
Example:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_2_to_name|apa}}
→ Apache languages<code>
:
{{#invoke:ISO 639 name|iso_639_code_2_to_name|xxx}}
→ error: xxx not found in ISO 639-2 list (help)Same as iso_639_code_to_name
except that <code>
must be an ISO 639-2B code; search is constrained to Module:ISO 639 name/ISO 639 override and Module:ISO 639 name/ISO 639-2B.
Example:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_2B_to_name|ice}}
→ Icelandic<code>
:
{{#invoke:ISO 639 name|iso_639_code_2B_to_name|xxx}}
→ error: xxx not found in ISO 639-2B list (help)Same as iso_639_code_to_name
except that <code>
must be an ISO 639-3 code; search is constrained to Module:ISO 639 name/ISO 639 override and Module:ISO 639 name/ISO 639-3.
Example:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_3_to_name|nav}}
→ Navaho<code>
:
{{#invoke:ISO 639 name|iso_639_code_3_to_name|xxx}}
→ error: xxx not found in ISO 639-3 list (help)Same as iso_639_code_to_name
except that <code>
must be an ISO 639-5 code; search is constrained to Module:ISO 639 name/ISO 639 override and Module:ISO 639 name/ISO 639-5.
Example:
<code>
:
{{#invoke:ISO 639 name|iso_639_code_5_to_name|apa}}
→ Apache languages<code>
:
{{#invoke:ISO 639 name|iso_639_code_5_to_name|xxx}}
→ error: xxx not found in ISO 639-5 list (help)Returns true
when <language name>
is found in one of the ISO 639-1, -2, -3, -5, or override tables; returns nil else.
Useage:
{{#invoke:ISO 639 name|iso_639_name_exists|<language name>}}
Examples:
<language name>
:
{{#invoke:ISO 639 name|iso_639_name_exists}}
→<language name>
:
{{#invoke:ISO 639 name|iso_639_name_exists|french}}
→ true<language name>
:
{{#invoke:ISO 639 name|iso_639_name_exists|fr}}
→Returns ISO 639 language code associated with <language name>
. May return an error message with or without a language name.
This function may not be particularly useful because, except for case, <language name>
must exactly match the name in the data tables.
Optional parameters:
<part>
(second positional parameter) – limits return to codes from the specified <part>
(1
, 2
, 3
, 5
), override table first then the appropriate data table; when not supplied, this function searches in order part 1 to part 5. The search stops when a match is found.|hide-err=yes
: suppresses error messagesExamples:
<part>
, with ISO 639-5 name:
{{#invoke:ISO 639 name|iso_639_name_to_code|North Germanic languages}}
→ gmq<part>
:
{{#invoke:ISO 639 name|iso_639_name_to_code|Navajo|2}}
→ navWhen given an ISO 639 language code, return the associated language name; when given a language name, returns the associated ISO 639 language code. May return an error message with or without a language code/name.
This function may not be particularly useful because, except for case, a provided <language name>
must exactly match the name in the data tables.
Optional parameters:
<part>
(second positional parameter) – limits return to codes/names from the specified <part>
(1
, 2
, 3
, 5
), override table first then the appropriate data table; when not supplied, this function searches in order part 1 to part 5. The search stops when a match is found.|hide-err=yes
: suppresses error messagesExamples:
<part>
, with ISO 639-5 code:
{{#invoke:ISO 639 name|iso_639|gmq}}
→ North Germanic languages<part>
, with ISO 639-5 name:
{{#invoke:ISO 639 name|iso_639|North Germanic languages}}
→ gmq<part>
and <code>
:
{{#invoke:ISO 639 name|iso_639|nav|2}}
→ Navajo<part>
and <name>
:
{{#invoke:ISO 639 name|iso_639|Navaho|2}}
→ nav