Difference between revisions of "Template:ConvertAbbrev/ISO 3166-1/numeric"
imported>Dudemanfellabra (add support for "force" parameter) |
imported>Dudemanfellabra (implement case insensitivity) |
||
| Line 250: | Line 250: | ||
| {{#ifeq:{{{force|}}}|long|{{{1}}}}} | | {{#ifeq:{{{force|}}}|long|{{{1}}}}} | ||
}}}}{{#ifeq:{{{force|}}}|long|| | }}}}{{#ifeq:{{{force|}}}|long|| | ||
| − | {{#switch: {{{1}}} | + | {{#switch: {{lc:{{{1}}}}} |
| − | | | + | |andorra=020 |
| − | | | + | |united arab emirates|uae|u.a.e.=784 |
| − | | | + | |afghanistan=004 |
| − | | | + | |antigua and barbuda=028 |
| − | | | + | |anguilla=660 |
| − | | | + | |albania=008 |
| − | | | + | |armenia=051 |
| − | | | + | |netherlands antilles=530 |
| − | | | + | |angola=024 |
| − | | | + | |antarctica|antarctique=010 |
| − | | | + | |argentina=032 |
| − | | | + | |american samoa=016 |
| − | | | + | |austria=040 |
| − | | | + | |australia=036 |
| − | | | + | |aruba=533 |
| − | | | + | |aland islands=248 |
| − | | | + | |azerbaijan=031 |
| − | | | + | |bosnia and herzegovina|bosnia|herzegovina=070 |
| − | | | + | |barbados=052 |
| − | | | + | |bangladesh=050 |
| − | | | + | |belgium=056 |
| − | | | + | |burkina faso|upper volta=854 |
| − | | | + | |bulgaria=100 |
| − | | | + | |bahrain=048 |
| − | | | + | |burundi=108 |
| − | | | + | |benin|dahomey=204 |
| − | | | + | |saint barthelemy|st. barthelemy|st barthelemy=652 |
| − | | | + | |bermuda=060 |
| − | | | + | |brunei darussalam|brunei=096 |
| − | | | + | |bolivia=068 |
| − | | | + | |brazil=076 |
| − | | | + | |bahamas=044 |
| − | | | + | |bhutan=064 |
| − | | | + | |bouvet island=074 |
| − | | | + | |botswana=072 |
| − | | | + | |belarus=112 |
| − | | | + | |belize=084 |
| − | | | + | |canada=124 |
| − | | | + | |cocos islands|cocos (keeling) islands|keeling islands=166 |
| − | | | + | |congo, the democratic republic of the|the democratic republic of the congo|zaire=180 |
| − | | | + | |central african republic=140 |
| − | | | + | |congo=178 |
| − | | | + | |switzerland|confoederatio helvetica=756 |
| − | | | + | |cote d'ivoire|ivory coast=384 |
| − | | | + | |cook islands=184 |
| − | | | + | |chile=152 |
| − | | | + | |cameroon=120 |
| − | | | + | |china=156 |
| − | | | + | |colombia=170 |
| − | | | + | |costa rica=188 |
| − | | | + | |cuba=192 |
| − | | | + | |cape verde=132 |
| − | | | + | |christmas island=162 |
| − | | | + | |cyprus=196 |
| − | | | + | |czech republic=203 |
| − | | | + | |deutschland|federal republic of germany|germany|germany, federal republic of=276 |
| − | | | + | |djibouti|french afar and issas=262 |
| − | | | + | |denmark=208 |
| − | | | + | |dominica=212 |
| − | | | + | |dominican republic=214 |
| − | | | + | |algeria|ledzayer=012 |
| − | | | + | |ecuador=218 |
| − | | | + | |estonia|eesti=233 |
| − | | | + | |egypt=818 |
| − | | | + | |sahara espanol|spanish sahara|western sahara=732 |
| − | | | + | |eritrea=232 |
| − | | | + | |espana|spain|canary islands|ceuta|melilla=724 |
| − | | | + | |ethiopia=231 |
| − | | | + | |finland=246 |
| − | | | + | |fiji=242 |
| − | | | + | |falkland islands|falkland islands (malvinas)|malvinas=238 |
| − | | | + | |federated states of micronesia|micronesia|micronesia, federated states of=583 |
| − | | | + | |faroe islands=234 |
| − | | | + | |france|clipperton island=250 |
| − | | | + | |gabon=266 |
| − | | | + | |great britain|northern ireland|united kingdom|united kingdom of great britain and northern ireland=826 |
| − | | | + | |grenada=308 |
| − | | | + | |georgia=268 |
<!-- | <!-- | ||
| − | | | + | |gilbert and ellice islands= |
--> | --> | ||
| − | | | + | |french guiana|guyane francaise=254 |
| − | | | + | |guernsey=831 |
| − | | | + | |ghana=288 |
| − | | | + | |gibraltar=292 |
| − | | | + | |greenland=304 |
| − | | | + | |gambia=270 |
| − | | | + | |guinea=324 |
| − | | | + | |guadeloupe=312 |
| − | | | + | |equatorial guinea|guinee equatoriale=226 |
| − | | | + | |greece=300 |
| − | | | + | |south georgia|south georgia and the south sandwich islands|south sandwich islands=239 |
| − | | | + | |guatemala=320 |
| − | | | + | |guam=316 |
| − | | | + | |guinea-bissau=624 |
| − | | | + | |guyana=328 |
| − | | | + | |hong kong=344 |
| − | | | + | |heard island|heard island and mcdonald islands|mcdonald islands=334 |
| − | | | + | |honduras=340 |
| − | | | + | |croatia|hrvatska=191 |
| − | | | + | |haiti=332 |
| − | | | + | |hungary=348 |
| − | | | + | |indonesia=360 |
| − | | | + | |ireland=372 |
| − | | | + | |israel=376 |
| − | | | + | |isle of man=833 |
| − | | | + | |india=356 |
| − | | | + | |british indian ocean territory|diego garcia=086 |
| − | | | + | |iraq=368 |
| − | | | + | |iran, islamic republic of|islamic republic of iran|iran=364 |
| − | | | + | |iceland=352 |
| − | | | + | |italy=380 |
| − | | | + | |jersey=832 |
| − | | | + | |jamaica=388 |
| − | | | + | |jordan=400 |
| − | | | + | |japan=392 |
| − | | | + | |kenya=404 |
| − | | | + | |kyrgyzstan=417 |
| − | | | + | |cambodia|kampuchea=116 |
| − | | | + | |kiribati=296 |
| − | | | + | |comoros|komori=174 |
| − | | | + | |saint kitts and nevis|saint kitts-nevis-anguilla|st kitts and nevis|st. kitts and nevis=659 |
| − | | | + | |democratic people's republic of korea|korea, democratic people's republic of|north korea|dprk=408 |
| − | | | + | |korea, republic of|republic of korea|south korea=410 |
| − | | | + | |kuwait=414 |
| − | | | + | |cayman islands=136 |
| − | | | + | |kazakhstan|kazakstan=398 |
| − | | | + | |lao people's democratic republic|laos=418 |
| − | | | + | |lebanon=422 |
| − | | | + | |saint lucia=662 |
| − | | | + | |liechtenstein=438 |
| − | | | + | |sri lanka=144 |
| − | | | + | |liberia=430 |
| − | | | + | |lesotho=426 |
| − | | | + | |lithuania=440 |
| − | | | + | |luxembourg=442 |
| − | | | + | |latvia=428 |
| − | | | + | |libyan arab jamahiriya|lybia=434 |
| − | | | + | |maroc|morocco=504 |
| − | | | + | |monaco=492 |
| − | | | + | |moldova|moldova, republic of|republic of moldova=498 |
| − | | | + | |montenegro=499 |
| − | | | + | |saint martin|saint martin (french part)=663 |
| − | | | + | |madagascar=450 |
| − | | | + | |marshall islands=584 |
| − | | | + | |macedonia, the former yugoslav republic of|makedonija|the former yugoslav republic of macedonia|macedonia=807 |
| − | | | + | |mali=466 |
| − | | | + | |burma|myanmar=104 |
| − | | | + | |mongolia=496 |
| − | | | + | |macao|macau=446 |
| − | | | + | |northern mariana islands=580 |
| − | | | + | |martinique=474 |
| − | | | + | |mauritania=478 |
| − | | | + | |montserrat=500 |
| − | | | + | |malta=470 |
| − | | | + | |mauritius=480 |
| − | | | + | |maldives=462 |
| − | | | + | |malawi=454 |
| − | | | + | |mexico=484 |
| − | | | + | |malaysia=458 |
| − | | | + | |mozambique=508 |
| − | | | + | |namibia=516 |
| − | | | + | |new caledonia=540 |
| − | | | + | |niger=562 |
| − | | | + | |norfolk island=574 |
| − | | | + | |nigeria=566 |
| − | | | + | |nicaragua=558 |
| − | | | + | |netherlands=528 |
| − | | | + | |norway=578 |
| − | | | + | |nepal=524 |
| − | | | + | |nauru=520 |
| − | | | + | |niue=570 |
| − | | | + | |new zealand=554 |
| − | | | + | |oman=512 |
| − | | | + | |panama=591 |
| − | | | + | |peru=604 |
| − | | | + | |french polynesia|polynesie francaise=258 |
| − | | | + | |papua new guinea=598 |
| − | | | + | |philippines=608 |
| − | | | + | |pakistan=586 |
| − | | | + | |poland=616 |
| − | | | + | |miquelon|saint pierre|saint pierre and miquelon|st. pierre|st pierre|st. pierre and miquelon|st pierre and miquelon=666 |
| − | | | + | |pitcairn=612 |
| − | | | + | |puerto rico=630 |
| − | | | + | |gaza strip|occupied palestinian territory|palestinian territory|palestinian territory, occupied|west bank|palestine=275 |
| − | | | + | |portugal=620 |
| − | | | + | |palau=585 |
| − | | | + | |paraguay=600 |
| − | | | + | |qatar=634 |
| − | | | + | |reunion=638 |
| − | | | + | |romania=642 |
| − | | | + | |serbia|republic of serbia=688 |
| − | | | + | |russian federation|tussia=643 |
| − | | | + | |rwanda=646 |
| − | | | + | |saudi arabia=682 |
| − | | | + | |british solomon islands|solomon islands=090 |
| − | | | + | |seychelles=690 |
| − | | | + | |sudan=736 |
| − | | | + | |sweden=752 |
| − | | | + | |singapore=702 |
| − | | | + | |ascension island|saint helena|st. helena|st helena|tristan da cunha=654 |
| − | | | + | |slovenia=705 |
| − | | | + | |jan mayen|svalbard|svalbard and jan mayen=744 |
| − | | | + | |slovakia=703 |
<!-- | <!-- | ||
| − | + | sikkim= | |
--> | --> | ||
| − | | | + | |sierra leone=694 |
| − | | | + | |san marino=674 |
| − | | | + | |senegal=686 |
| − | | | + | |somalia=706 |
| − | | | + | |suriname=740 |
| − | | | + | |sao tome and principe=678 |
| − | | | + | |el salvador=222 |
| − | | | + | |syrian arab republic|syria=760 |
| − | | | + | |swaziland=748 |
| − | | | + | |turks and caicos islands=796 |
| − | | | + | |chad|tchad=148 |
| − | | | + | |french antarctic lands|french southern lands|french southern territories|terres australes francaises=260 |
| − | | | + | |togo=768 |
| − | | | + | |thailand=764 |
| − | | | + | |tajikistan=762 |
| − | | | + | |tokelau=772 |
| − | | | + | |timor-leste|east timor=626 |
| − | | | + | |turkmenistan=795 |
| − | | | + | |tunisia=788 |
| − | | | + | |tonga=776 |
| − | | | + | |turkey=792 |
| − | | | + | |trinidad and tobago=780 |
| − | | | + | |tuvalu=798 |
| − | | | + | |province of china, taiwan|republic of china|taiwan|taiwan, province of china=158 |
| − | | | + | |tanzania, united republic of|united republic of tanzania|tanzania=834 |
| − | | | + | |ukraine|ukrainian s.s.r.=804 |
| − | | | + | |uganda=800 |
| − | | | + | |united states minor outlying islands|baker island|howland island|jarvis island|johnston atoll|kingman reef|midway atoll|navassa island|palmyra atoll|wake island=581 |
| − | | | + | |united States|united states of america=840 |
| − | | | + | |uruguay=858 |
| − | | | + | |uzbekistan=860 |
| − | | | + | |holy see|holy see (vatican city state)|vatican city state|vatican city state (holy see)|vatican city=336 |
| − | | | + | |saint vincent and the grenadines=670 |
| − | | | + | |venezuela=862 |
| − | | | + | |british virgin islands|virgin islands, british=092 |
| − | | | + | |u.s. virgin islands|virgin islands, u.s.=850 |
| − | | | + | |viet nam|vietnam=704 |
| − | | | + | |new hebrides|vanuatu=548 |
| − | | | + | |wallis and futuna=876 |
| − | | | + | |samoa|western samoa=882 |
| − | | | + | |yemen|republic of yemen|yemen, republic of=887 |
| − | | | + | |mayotte=175 |
| − | | | + | |south africa|zuid-afrika=710 |
| − | | | + | |zambia=894 |
| − | | | + | |zimbabwe=716 |
| {{#ifeq:{{{force|}}}|abbr|{{uc:{{{1}}}}}}} | | {{#ifeq:{{{force|}}}|abbr|{{uc:{{{1}}}}}}} | ||
}}}}<noinclude>{{Documentation|Template:ConvertAbbrev/doc}}</noinclude> | }}}}<noinclude>{{Documentation|Template:ConvertAbbrev/doc}}</noinclude> | ||
Revision as of 17:21, 21 August 2011
This template is used to convert commonly abbreviated things such as countries, states, provinces, and even language codes to and from their abbreviations. A hierarchical tree of subtemplates allows this template to convert virtually anything, which is really good for use in a backdoor template. If you have the word "California", but the template you're trying to use will only recognize "CA", use this to convert it!
How to use the template
Syntax: {{ConvertAbbrev|datatype|specification|value|force=abbr or long}}
This template consists of a "tree" of subtemplates containing databases of abbreviations. Each successive parameter in the code input tells the template which database to query. The datatype parameter is the most broad and tells the template what type of information you are looking for (i.e. Countries, states, or languages). The specification parameter refines the search. For example, if the datatype parameter is "ISO 3166-1", that tells the template to look for a subtype (alpha2, alpha3, or numeric). If the datatype parameter is "ISO 3166-2", the template will look for a specific country (Canada, Mexico, United States, etc.). If the datatype parameter is "ISO 639-1", the template looks for the name of a language (English, Spanish, Zulu, etc.). The value parameter is the actual name or abbreviation the user wishes to convert.
The force parameter overrides the normal nature of the conversion and forces an abbreviation or a long word to be returned. This is useful when a user may input either an abbreviation or a full name, but the template in question can only accept one of them.
If the ISO codes are a little hard to remember, there are also shortcuts:
{{ConvertAbbrev|ISO 3166-1|alpha-2|__country__}}can also be called by{{ConvertAbbrev|Countries|alpha-2|__country__}}or{{ConvertAbbrev|Countries|__country__}}.
Note: The default for country abbreviations is alpha-2. For alpha-3 and numeric abbreviations, the user must specify the type in the specification parameter.
{{ConvertAbbrev|ISO 3166-2|CA|__province__}}can also be called by{{ConvertAbbrev|Countries|CA|__province__}},{{ConvertAbbrev|Countries|Canada|__province__}},{{ConvertAbbrev|Canada|__province__}}, or{{ConvertAbbrev|CN|__province__}}.
{{ConvertAbbrev|ISO 639-1|__language__}}can also be called by{{ConvertAbbrev|Languages|-1|__language__}}or{{ConvertAbbrev|Languages|__language__}}.
Note: The default for language abbreviations is ISO 639-1. For ISO 639-2 abbreviations, the user must specify the type in the specification parameter.
{{ConvertAbbrev|ISO 639-2|__language__}}can also be called by{{ConvertAbbrev|Languages|-2|__language__}}.
Supported datasets
- ISO 3166-1 – Country abbreviations
- ISO 3166-2 – State/provincial abbreviations
Note: All ISO 3166-2 codes should not include the 3166-1 country code in the value parameter. (e.g. If you're looking for Paris ["FR-75" in ISO 3166-2:FR], you should only type "75" and not "FR-75".)- ISO 3166-2:AU – States and territories of Australia
- ISO 3166-2:BD – Districts of Bangladesh
- ISO 3166-2:BR – States of Brazil
- ISO 3166-2:CA – Canadian subnational postal abbreviations
- ISO 3166-2:CN – Administrative divisions of China
- ISO 3166-2:DE – States of Germany
- ISO 3166-2:EG – Governorates of Egypt
- ISO 3166-2:ES – Provinces of Spain
- ISO 3166-2:FR – Departments of France
- ISO 3166-2:GB – Administrative geography of the United Kingdom
- ISO 3166-2:ID – Provinces of Indonesia
- ISO 3166-2:IE – Counties of Ireland
- ISO 3166-2:IN – States and territories of India
- ISO 3166-2:IT – Provinces of Italy
- ISO 3166-2:JP – Prefectures of Japan
- ISO 3166-2:MX – Political divisions of Mexico
- ISO 3166-2:NG – States of Nigeria
- ISO 3166-2:PK – Administrative units of Pakistan
- ISO 3166-2:RU – Federal subjects of Russia
- ISO 3166-2:TR – Provinces of Turkey
- ISO 3166-2:US – United States postal abbreviations
- ISO 3166-2:VN – Provinces of Vietnam
- ISO 639 – Language codes
Usage Examples
|
|
Sub-pages
For a list of all the sub-pages of this template, see: Special:PrefixIndex/Template:ConvertAbbrev
| The above documentation is transcluded from Template:ConvertAbbrev/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |