Module:ISO 639 name/doc
{{Lua|Module:Arguments|Module:No globals|Module:Language/data/ISO 639-1|Module:Language/data/ISO 639-2|Module:Language/data/ISO 639-3|Module:Language/data/ISO 639-5|Module:Language/data/ISO 639 deprecated|Module:Language/data/ISO 639-3 (dep)|Module:Language/data/ISO 639 override|Module:Language/data/ISO 639 name to code|noprotcat=yes}}
 {{High-use}}
 
 '''Module:ISO 639 name''' implements:
 * {{tlx|ISO 639 name}}
 * {{tlx|Lang2iso}}
 
 
 == Data mapping ==
 For code-to-name mapping, this module uses data from:
 * [[Module:Language/data/ISO 639-1]] – from IANA [https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry language-subtag-registry file]; this data used only for ISO 639-1 language codes / names listed there
 * [[Module:Language/data/ISO 639-2]] – from [https://www.loc.gov/standards/iso639-2/php/English_list.php Codes for the Representation of Names of Languages]
 * [[Module:Language/data/ISO 639-2B]] – from Codes for the Representation of Names of Languages
 * [[Module:Language/data/ISO 639-3]] – from [http://www-01.sil.org/iso639-3/download.asp sil.org UTF-8 Complete Code Tables Set]
 * [[Module:Language/data/ISO 639-5]] – from [https://www.loc.gov/standards/iso639-5/id.php Codes for the Representation of Names of Languages Part 5]
 * [[Module:Language/data/ISO 639 deprecated]] – from [https://www.loc.gov/standards/iso639-2/php/code_changes.php ISO 639-2/RA Change Notice] and [https://www.loc.gov/standards/iso639-5/changes.php ISO 639-5 Change Notice] includes:
 ** [[Module:Language/data/ISO 639-3 (dep)]] – from [http://www-01.sil.org/iso639-3/download.asp sil.org UTF-8 Complete Code Tables Set] (Retirements)
 * [[Module:Language/data/ISO 639 override]] – code to name mapping where the name is different from the name in the ISO 639 standard
 For name-to-code mapping, this module uses data from:
 * [[Module:Language/data/ISO 639 name to code]] – names and codes extracted from the code-to-name data set above
 
 == Testcases ==
 * [[Module:ISO 639 name/testcases]] ([[Module talk:ISO 639 name/testcases|run]])
 * code_to_name()
 ** [[Module:ISO 639 name/testcases/ISO 639-1 name from code]] ([[Module talk:ISO 639 name/testcases/ISO 639-1 name from code|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-2 name from code]] ([[Module talk:ISO 639 name/testcases/ISO 639-2 name from code|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-3-1 name from code]] (A–H) ([[Module talk:ISO 639 name/testcases/ISO 639-3-1 name from code|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-3-2 name from code]] (I–N) ([[Module talk:ISO 639 name/testcases/ISO 639-3-2 name from code|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-3-3 name from code]] (O–Z) ([[Module talk:ISO 639 name/testcases/ISO 639-3-3 name from code|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-5 name from code]] ([[Module talk:ISO 639 name/testcases/ISO 639-5 name from code|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639 deprecated name from code]] ([[Module talk:ISO 639 name/testcases/ISO 639 deprecated name from code|run]])
 * name_to_code()
 ** [[Module:ISO 639 name/testcases/ISO 639-1 code from name]] ([[Module talk:ISO 639 name/testcases/ISO 639-1 code from name|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-2 code from name]] ([[Module talk:ISO 639 name/testcases/ISO 639-2 code from name|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-3-1 code from name]] (A–H) ([[Module talk:ISO 639 name/testcases/ISO 639-3-1 code from name|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-3-2 code from name]] (I–N) ([[Module talk:ISO 639 name/testcases/ISO 639-3-2 code from name|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-3-3 code from name]] (O–Z) ([[Module talk:ISO 639 name/testcases/ISO 639-3-3 code from name|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639-5 code from name]] ([[Module talk:ISO 639 name/testcases/ISO 639-5 code from name|run]])
 ** [[Module:ISO 639 name/testcases/ISO 639 deprecated code from name]] ([[Module talk:ISO 639 name/testcases/ISO 639 deprecated code from name|run]])
 
 == Tracking categories ==
 * {{Category link with count|ISO 639 name template errors}}
 
 ==iso_639_code_exists==
 Returns &lt;code&gt;true&lt;/code&gt; when &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; is found in one of the ISO 639-1, -2, -3, -5, or override tables; returns nil else.
 
 Useage:
 :&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_exists|&lt;/nowiki&gt;&amp;lt;{{var|code}}&gt;}}&lt;/code&gt;
 
 Examples:
 :without required &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_exists}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_exists}}
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_exists|nav}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_exists|nav}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_exists|xx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_exists|xx}}
 
 ==iso_639_code_to_name==
 Returns language name associated with &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;.  May return an error message with or without a language name.
 
 Optional parameters:
 :{{para|hide-err|yes}}: suppresses error messages
 :{{para|link|yes}}: creates link to en.wiki article about the language
 ::{{para|label|&amp;lt;{{var|label text}}&gt;}} – requires {{para|link|yes}}; label for the language-name link: &lt;code&gt;&lt;nowiki&gt;[[&lt;/nowiki&gt;&amp;lt;{{var|language name}}&gt; language|&amp;lt;{{var|label text}}&gt;]]&lt;/code&gt;
 :{{para|raw|yes}}: queries part tables only; returns language name as defined in the base data tables without the removal of disambiguation information
 Examples:
 :without required &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|cat=no}}
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|nav}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|nav}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|xx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|xx|cat=no}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; ([[IETF language tag]]):
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|nv-Latn}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|nv-Latn|cat=no}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;, error message suppressed:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|nv-Latn|hide-err=yes}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|nv-Latn|hide-err=yes}}
 :linked:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|nav|link=yes}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|nav|link=yes}}
 :linked with alternate spelling:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|nav|link=yes|label=Navaho}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|nav|link=yes|label=Navaho}}
 :ISO 639-1 code &lt;code&gt;el&lt;/code&gt; is normally overridden by a setting in [[Module:Language/data/ISO_639_override]]:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|el}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|el}}
 :ISO 639-1 code &lt;code&gt;el&lt;/code&gt; with override suppressed:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|el|raw=yes}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|el|raw=yes}}
 :ISO 639-3 code &lt;code&gt;ina&lt;/code&gt; name has disambiguation that is normally suppressed:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|ina}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|ina}}
 :ISO 639-3 code &lt;code&gt;ina&lt;/code&gt; with disambiguation:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_to_name|ina|raw=yes}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_to_name|ina|raw=yes}}
 
 ==iso_639_code_1_to_name==
 Same as &lt;code&gt;iso_639_code_to_name&lt;/code&gt; except that &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; must be an ISO 639-1 code; search is constrained to [[Module:Language/data/ISO 639 override]] and [[Module:Language/data/ISO 639-1]].
 
 Example:
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_1_to_name|nv}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_1_to_name|nv}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_1_to_name|xx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_1_to_name|xx|cat=no}}
 
 ==iso_639_code_2_to_name==
 Same as &lt;code&gt;iso_639_code_to_name&lt;/code&gt; except that &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; must be an ISO 639-2 code; search is constrained to [[Module:Language/data/ISO 639 override]] and [[Module:Language/data/ISO 639-2]].
 
 Example:
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_2_to_name|apa}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_2_to_name|apa}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_2_to_name|xxx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_2_to_name|xxx|cat=no}}
 
 ==iso_639_code_2B_to_name==
 Same as &lt;code&gt;iso_639_code_to_name&lt;/code&gt; except that &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; must be an ISO 639-2B code; search is constrained to [[Module:Language/data/ISO 639 override]] and [[Module:Language/data/ISO 639-2B]].
 
 Example:
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_2B_to_name|ice}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_2B_to_name|ice}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_2B_to_name|xxx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_2B_to_name|xxx|cat=no}}
 
 ==iso_639_code_3_to_name==
 Same as &lt;code&gt;iso_639_code_to_name&lt;/code&gt; except that &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; must be an ISO 639-3 code; search is constrained to [[Module:Language/data/ISO 639 override]] and [[Module:Language/data/ISO 639-3]].
 
 Example:
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_3_to_name|nav}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_3_to_name|nav}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_3_to_name|xxx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_3_to_name|xxx|cat=no}}
 
 ==iso_639_code_5_to_name==
 Same as &lt;code&gt;iso_639_code_to_name&lt;/code&gt; except that &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt; must be an ISO 639-5 code; search is constrained to [[Module:Language/data/ISO 639 override]] and [[Module:Language/data/ISO 639-5]].
 
 Example:
 :with valid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_5_to_name|apa}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_5_to_name|apa}}
 :with invalid &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_code_5_to_name|xxx}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_code_5_to_name|xxx|cat=no}}
 
 ==iso_639_name_exists==
 Returns &lt;code&gt;true&lt;/code&gt; when &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt; is found in one of the ISO 639-1, -2, -3, -5, or override tables; returns nil else.
 
 Useage:
 :&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_name_exists|&lt;/nowiki&gt;&amp;lt;{{var|language name}}&gt;}}&lt;/code&gt;
 
 Examples:
 :without required &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_name_exists}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_name_exists}}
 :with valid &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_name_exists|french}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_name_exists|french}}
 :with invalid &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_name_exists|fr}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_name_exists|fr}}
 
 ==iso_639_name_to_code==
 Returns ISO 639 language code associated with &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt;.  May return an error message with or without a language name.
 
 This function may not be particularly useful because, except for case, &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt; must exactly match the name in the data tables.
 
 Optional parameters:
 :&lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt; (second positional parameter) – limits return to codes from the specified &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt; (&lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;, &lt;code&gt;3&lt;/code&gt;, &lt;code&gt;5&lt;/code&gt;), 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.
 :{{para|hide-err|yes}}: suppresses error messages
 
 Examples:
 :without &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt;, with ISO 639-5 name:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_name_to_code|North Germanic languages}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_name_to_code|North Germanic languages}}
 :with &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639_name_to_code|Navajo|2}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639_name_to_code|Navajo|2}}
 
 ==iso_639==
 When 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 &lt;code&gt;&amp;lt;{{var|language name}}&gt;&lt;/code&gt; must exactly match the name in the data tables.
 
 Optional parameters:
 :&lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt; (second positional parameter) – limits return to codes/names from the specified &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt; (&lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;, &lt;code&gt;3&lt;/code&gt;, &lt;code&gt;5&lt;/code&gt;), 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.
 :{{para|hide-err|yes}}: suppresses error messages
 
 Examples:
 :without &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt;, with ISO 639-5 code:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639|gmq}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639|gmq}}
 :without &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt;, with ISO 639-5 name:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639|North Germanic languages}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639|North Germanic languages}}
 :with &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;{{var|code}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639|nav|2}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639|nav|2}}
 :with &lt;code&gt;&amp;lt;{{var|part}}&gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;{{var|name}}&gt;&lt;/code&gt;:
 ::&lt;code&gt;&lt;nowiki&gt;{{#invoke:ISO 639 name|iso_639|Navaho|2}}&lt;/nowiki&gt;&lt;/code&gt; → {{#invoke:ISO 639 name|iso_639|Navaho|2}}
 
 &lt;includeonly&gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 &lt;!-- Categories below this line, please; interwikis at Wikidata --&gt;
 [[Category:Language-related modules]]