Module:ISO 3166/doc: Difference between revisions

Content deleted Content added
No edit summary
 
(7 intermediate revisions by 6 users not shown)
Line 2:
{{High risk|493000+}}
 
This module returns a country's or subdivision's code (alpha-2, alpha-3, numeric) or name (ISO, non-ISO) from [[ISO 3166]] from a varityvariety of inputs (alpha-2, alpha-3, numeric, name, ISO-name, alternative names). The module also removes junk from the input.
==Examples==
===Countries (ISO 3166-1)===
Line 12:
*{{tnull|#invoke:ISO 3166|name|826}} → {{#invoke:ISO 3166|name|826}}
====ISO Name====
To get the commonISO name use the name function with isoname = yes
*{{tnull|#invoke:ISO 3166|name|GB|isoname{{=}}yes}} → {{#invoke:ISO 3166|name|GB|isoname=yes}}
*{{tnull|#invoke:ISO 3166|name|GBR|isoname{{=}}yes}} → {{#invoke:ISO 3166|name|GBR|isoname=yes}}
*{{tnull|#invoke:ISO 3166|name|826|isoname{{=}}yes}} → {{#invoke:ISO 3166|name|826|isoname=yes}}
 
====Alpha-2====
To get the alpha 2 code use the code function
Line 24 ⟶ 25:
To get the alpha 3 code use the code function with codetype = 3
*{{tnull|#invoke:ISO 3166|code|United Kingdom|codetype{{=}}alpha3}} → {{#invoke:ISO 3166|code|United Kingdom|codetype=alpha3}}
*{{tnull|#invoke:ISO 3166|name|GB|codetype{{=}}alpha3}} → {{#invoke:ISO 3166|name|GB|codetype=alpha3}}
*{{tnull|#invoke:ISO 3166|name|GBR|codetype{{=}}alpha3}} → {{#invoke:ISO 3166|name|GBR|codetype=alpha3}}
*{{tnull|#invoke:ISO 3166|name|826|codetype{{=}}alpha3}} → {{#invoke:ISO 3166|name|826|codetype=alpha3}}
*{{tnull|#invoke:ISO 3166|code|UK|codetype{{=}}alpha3}} → {{#invoke:ISO 3166|code|UK|codetype=alpha3}}
====Numeric====
Line 49 ⟶ 50:
*{{tnull|#invoke:ISO 3166|name|BE|BRU|lang{{=}}fr}} → {{#invoke:ISO 3166|name|BE|BRU|lang=fr}}
*{{tnull|#invoke:ISO 3166|name|BE|BRU|lang{{=}}nl}} → {{#invoke:ISO 3166|name|BE|BRU|lang=nl}}
 
== Tracking categories ==
* {{clc|Wikipedia pagearticles with obscure country}}
* {{clc|Wikipedia pagearticles with obscure country or subdivision}}
* {{clc|Wikipedia pagearticles with obscure subdivision}}
 
==See also==
*[[Wikipedia:Templates for discussion/Log/2015 November 12#Template:ISO 3166 name DE-HB]] – discussion of replacement of [[Template:ISO 3166 conversion template doc|template-based system]] with Lua
Line 68 ⟶ 71:
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Data retrieval templates]]
}}</includeonly><noinclude>
[[Category:Module documentation pages]]
</noinclude>