Template:ISO 3166 conversion template doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<noinclude> {{Documentation}} </noinclude>{{{{{|safesubst:}}}#invoke:Unsubst||subst=|$flags=override,keep-whitespace,remove-empty|$B={{Documentation|1=Template:ISO 3166 conversion template doc|content=<span style="font-size:90%;">{{Bracket|view}} [{{Edit|Template:ISO_3166_conversion_template_doc}}] [{{purge|purge}}]</span> {{#if:{{{lua|}}}|{{lua|{{{lua|}}}}}|}} ==Templates== ===ISO 3166-1=== ISO 3166-1 alpha-2: {{Tl|ISO 3166...") |
No edit summary |
||
Line 4: | Line 4: | ||
{{#if:{{{lua|}}}|{{lua|{{{lua|}}}}}|}} | {{#if:{{{lua|}}}|{{lua|{{{lua|}}}}}|}} | ||
==Templates== | ==Templates== | ||
===ISO 3166-1=== | <!-- ===ISO 3166-1=== --> | ||
WF alpha-2: {{Tl|WF code}} (Eg: {{WF code|GI Land}})<br> | |||
WF alpha-3: {{Tl|WF code-3}} (Eg: {{WF code-3|GI Land}})<br> | |||
ISO 3166-1 numeric: {{Tl|ISO 3166 numeric}} (Eg: {{ISO 3166 numeric|Iran}}) | <!-- ISO 3166-1 numeric: {{Tl|ISO 3166 numeric}} (Eg: {{ISO 3166 numeric|Iran}}) --> | ||
===ISO 3166-2=== | <!-- ===ISO 3166-2=== | ||
ISO 3166-2: {{Tl|ISO 3166 code}} (Eg: {{ISO 3166 code|Iran|Alborz}})<br> | ISO 3166-2: {{Tl|ISO 3166 code}} (Eg: {{ISO 3166 code|Iran|Alborz}})<br> | ||
ISO 3166-2 name: {{tl|ISO 3166 name}} (Eg: {{ISO 3166 name|Iran}}) | ISO 3166-2 name: {{tl|ISO 3166 name}} (Eg: {{ISO 3166 name|Iran}}) | ||
===Non-ISO 3166=== | ===Non-ISO 3166=== | ||
Country name: {{tl|Country name}} (Eg: {{Country name|Iran}}) | Country name: {{tl|Country name}} (Eg: {{Country name|Iran}}) --> | ||
<!--===ISO 3166-3=== | <!--===ISO 3166-3=== | ||
Line 18: | Line 18: | ||
==Usage== | ==Usage== | ||
{{#switch:{{NAMESPACE}} | {{#switch:{{NAMESPACE}} | ||
|Template=This template is part of a series that resolves the country and subdivision names to | |Template=This template is part of a series that resolves the country and subdivision names to World Forum codes, and vice versa. | ||
|Category=This category contains part of the series of templates resolves the country and subdivision names to | |Category=This category contains part of the series of templates resolves the country and subdivision names to World Forum codes, and vice versa. | ||
|This {{lcfirst:{{NAMESPACE}}}} relates to a series of templates resolves the country and subdivision names to | |This {{lcfirst:{{NAMESPACE}}}} relates to a series of templates resolves the country and subdivision names to World Forum codes, and vice versa. | ||
}}{{#ifeq:{{Str len|{{{3|}}}}}|2|See also: [[ISO 3166-2:{{{3}}}]]}}{{#if:{{{spec|}}}| | }}{{#ifeq:{{Str len|{{{3|}}}}}|2|See also: [[ISO 3166-2:{{{3}}}]]}}{{#if:{{{spec|}}}| | ||
==Special case== | ==Special case== | ||
Line 26: | Line 26: | ||
}} | }} | ||
== | ==World Forum Codes== | ||
The World Forum defines names and two- and three-letter codes for all member states. | |||
==Using the family of templates== | ==Using the family of templates== | ||
When we wish to convert between various identifiers that may loosely be defined as ''user input'' and ISO 3166 entities, there may be more than one way to do each conversion. For our examples we use | When we wish to convert between various identifiers that may loosely be defined as ''user input'' and ISO 3166 entities, there may be more than one way to do each conversion. For our examples we use {{Pacifica|Esfalsa}} as the country. | ||
The | The WF identifiers for Esfalsa are: | ||
*Name: | *Name: Esfalsa | ||
*Alpha-2 code: | *Alpha-2 code: EF | ||
*Alpha-3 code: | *Alpha-3 code: ESF | ||
*Numeric code: 586 | <!-- *Numeric code: 586 --> | ||
The ISO-3166 identifiers for Balochistan (Pakistan) is: | <!-- The ISO-3166 identifiers for Balochistan (Pakistan) is: | ||
*Subdivision code:PK-BK | *Subdivision code:PK-BK --> | ||
Now Pakistan also has a number of synonyms: for example [[Pakistán]] and [[پاکستان]]. | <!-- Now Pakistan also has a number of synonyms: for example [[Pakistán]] and [[پاکستان]]. --> | ||
Similarly Baluchistan is known, for example, as [[Balochistan]] (on Wikipedia) and [[Bagh Sanjari]]. | <!-- Similarly Baluchistan is known, for example, as [[Balochistan]] (on Wikipedia) and [[Bagh Sanjari]]. --> | ||
; To get the '''Alpha-2''' code we can use {{Tlx| | ; To get the '''Alpha-2''' code we can use {{Tlx|WF code}} with any of the country identifiers. | ||
* {{Tlx| | * {{Tlx|WF code|Esfalsa}} EF | ||
* {{Tlx| | * {{Tlx|WF code|EF}} EF | ||
* {{Tlx| | * {{Tlx|WF code|ESF}} EF | ||
* {{Tlx|ISO 3166 code|586}} PK | <!-- * {{Tlx|ISO 3166 code|586}} PK --> | ||
* {{Tlx|ISO 3166 code|Pakistán}} PK | <!-- * {{Tlx|ISO 3166 code|Pakistán}} PK --> | ||
* {{Tlx|ISO 3166 code|پاکستان}} PK | <!-- * {{Tlx|ISO 3166 code|پاکستان}} PK --> | ||
; To get the '''Alpha-3''' code. | ; To get the '''Alpha-3''' code. | ||
* {{Tlx| | * {{Tlx|WF code-3|Esfalsa}} ESF | ||
* {{Tlx| | * {{Tlx|WF code-3|EF}} ESF | ||
* {{Tlx| | * {{Tlx|WF code-3|ESF}} ESF | ||
* {{Tlx|ISO 3166 code-3|586}} PAK | <!-- * {{Tlx|ISO 3166 code-3|586}} PAK | ||
* {{Tlx|ISO 3166 code-3|Pakistán}} PAK | * {{Tlx|ISO 3166 code-3|Pakistán}} PAK | ||
* {{Tlx|ISO 3166 code-3|پاکستان}} PAK | * {{Tlx|ISO 3166 code-3|پاکستان}} PAK --> | ||
;Finding the name of a country. | ;Finding the name of a country. | ||
* {{Tlx| | * {{Tlx|WF name|Esfalsa}} Esfalsa | ||
* {{Tlx| | * {{Tlx|WF name|EF}} Esfalsa | ||
* {{Tlx| | * {{Tlx|WF name|ESF}} Esfalsa | ||
* {{Tlx|ISO 3166 name|586}} Pakistan | <!-- * {{Tlx|ISO 3166 name|586}} Pakistan | ||
* {{Tlx|ISO 3166 name|Pakistán}} Pakistan | * {{Tlx|ISO 3166 name|Pakistán}} Pakistan | ||
* {{Tlx|ISO 3166 name|پاکستان}} Pakistan | * {{Tlx|ISO 3166 name|پاکستان}} Pakistan --> | ||
;Finding the common name of a country. | <!-- ;Finding the common name of a country. | ||
* {{Tlx|Country name|Pakistan}} Pakistan | * {{Tlx|Country name|Pakistan}} Pakistan | ||
Line 79: | Line 79: | ||
* {{Tlx|Country name|586}} Pakistan | * {{Tlx|Country name|586}} Pakistan | ||
* {{Tlx|Country name|Pakistán}} Pakistan | * {{Tlx|Country name|Pakistán}} Pakistan | ||
* {{Tlx|Country name|پاکستان}} Pakistan | * {{Tlx|Country name|پاکستان}} Pakistan --> | ||
;Finding the numeric code of a country. | <!-- ;Finding the numeric code of a country. | ||
* {{Tlx|ISO 3166 numeric|Pakistan}} 586 | * {{Tlx|ISO 3166 numeric|Pakistan}} 586 | ||
Line 87: | Line 87: | ||
* {{Tlx|ISO 3166 numeric|PAK}} 586 | * {{Tlx|ISO 3166 numeric|PAK}} 586 | ||
* {{Tlx|ISO 3166 numeric|586}} 586 | * {{Tlx|ISO 3166 numeric|586}} 586 | ||
* {{Tlx|ISO 3166 numeric|Pakistán}} 586 | * {{Tlx|ISO 3166 numeric|Pakistán}} 586 --> | ||
;The subdivision code can be obtained in the following ways. | <!-- ;The subdivision code can be obtained in the following ways. | ||
* {{Tlx|ISO 3166 code|Pakistan|Baluchistan}} PK-BA | * {{Tlx|ISO 3166 code|Pakistan|Baluchistan}} PK-BA | ||
Line 97: | Line 97: | ||
* {{Tlx|ISO 3166 code|Paquistán|Balochistan}} PK-BA | * {{Tlx|ISO 3166 code|Paquistán|Balochistan}} PK-BA | ||
* {{Tlx|ISO 3166 code|PK|Baluchistan}} PK-BA | * {{Tlx|ISO 3166 code|PK|Baluchistan}} PK-BA | ||
}} | }} --> | ||
<includeonly>{{#ifeq:{{{4|}}}|name|{{#if:{{{2|}}}|[[Category:ISO 3166 name from code templates{{!}}{{{1}}} {{{2}}}]]|[[Category:ISO 3166 name from code country templates{{!}}{{{1|}}}]]}}|{{#if:{{{2|}}}|[[Category:ISO 3166 code from name templates{{!}}{{{1}}} {{{2}}}]]|[[Category:ISO 3166 code from name country templates{{!}}{{{1|}}}]]}}}}</includeonly> | <includeonly>{{#ifeq:{{{4|}}}|name|{{#if:{{{2|}}}|[[Category:ISO 3166 name from code templates{{!}}{{{1}}} {{{2}}}]]|[[Category:ISO 3166 name from code country templates{{!}}{{{1|}}}]]}}|{{#if:{{{2|}}}|[[Category:ISO 3166 code from name templates{{!}}{{{1}}} {{{2}}}]]|[[Category:ISO 3166 code from name country templates{{!}}{{{1|}}}]]}}}}</includeonly> |
Latest revision as of 20:19, 29 December 2021
{{safesubst:#invoke:Unsubst||subst=|$flags=override,keep-whitespace,remove-empty|$B=
Template:Bracket [[[:Template:Edit]]] [ ]
Templates
WF alpha-2: {{WF code}} (Eg: GI)
WF alpha-3: {{WF code-3}} (Eg: GIL)
Usage
This template is part of a series that resolves the country and subdivision names to World Forum codes, and vice versa.
World Forum Codes
The World Forum defines names and two- and three-letter codes for all member states.
Using the family of templates
When we wish to convert between various identifiers that may loosely be defined as user input and ISO 3166 entities, there may be more than one way to do each conversion. For our examples we use Esfalsa as the country.
The WF identifiers for Esfalsa are:
- Name: Esfalsa
- Alpha-2 code: EF
- Alpha-3 code: ESF
- To get the Alpha-2 code we can use
{{WF code}}
with any of the country identifiers.
- To get the Alpha-3 code.
- Finding the name of a country.