Template:ISO 3166 conversion template doc: Difference between revisions

From TSP Encyclopedia
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=== -->
ISO 3166-1 alpha-2: {{Tl|ISO 3166 code}} (Eg: {{ISO 3166 code|Iran}})<br>
WF alpha-2: {{Tl|WF code}} (Eg: {{WF code|GI Land}})<br>
ISO 3166-1 alpha-3: {{Tl|ISO 3166 code-3}} (Eg: {{ISO 3166 code-3|Iran}})<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 [[ISO 3166-1]] and [[ISO 3166-2]] codes, and vice versa.
|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 [[ISO 3166-1]] and [[ISO 3166-2]] codes, and vice versa.
|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 [[ISO 3166-1]] and [[ISO 3166-2]] codes, and vice versa.
|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:
}}
}}


==ISO 3166==
==World Forum Codes==
ISO 3166 defines names, two and three letter codes and code numbers for all countries and six character codes (the two letter country code followed by a dash and a two or three character subdivision code) for all top level subdivisions.  
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 [[Pakistan]] as the country and [[Balochistan (Pakistan)]] as the subdivision.
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 ISO-3166 identifiers for Pakistan are:
The WF identifiers for Esfalsa are:
*Name: Pakistan
*Name: Esfalsa
*Alpha-2 code: PK
*Alpha-2 code: EF
*Alpha-3 code: PAK
*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|ISO 3166 code}} with any of the country identifiers.
; To get the '''Alpha-2''' code we can use {{Tlx|WF code}} with any of the country identifiers.


* {{Tlx|ISO 3166 code|Pakistan}} PK
* {{Tlx|WF code|Esfalsa}} EF
* {{Tlx|ISO 3166 code|PK}} PK
* {{Tlx|WF code|EF}} EF
* {{Tlx|ISO 3166 code|PAK}} PK
* {{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|ISO 3166 code-3|Pakistan}} PAK
* {{Tlx|WF code-3|Esfalsa}} ESF
* {{Tlx|ISO 3166 code-3|PK}} PAK
* {{Tlx|WF code-3|EF}} ESF
* {{Tlx|ISO 3166 code-3|PAK}} PAK
* {{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|ISO 3166 name|Pakistan}} Pakistan
* {{Tlx|WF name|Esfalsa}} Esfalsa
* {{Tlx|ISO 3166 name|PK}} Pakistan
* {{Tlx|WF name|EF}} Esfalsa
* {{Tlx|ISO 3166 name|PAK}} Pakistan
* {{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=