-=============================================================
- CountryAbbr2 - Get country code by span flag image+wikilink
-==============================================================
- (see NOTES at bottom)
-
-->}}}
 --> 
 --> | flag alias=Flag of Canada.svg}} =CA-}}}
 --> | flag alias=Flag of England.svg}}
 --> | flag alias=Flag of Wales 2.svg}}
 --> | flag alias=Flag of Scotland.svg}}
 --> | flag alias=Flag of the United Kingdom.svg}} =GB
 --> =PL
 --> | flag alias=Flag of France.svg}} =FR}}}
 --> | alias=People's Republic of China <!--
 --> | name=China <!--
 --> | flag alias=Flag of the People's Republic of China.svg}}
 --> | alias=People's Republic of China <!--
 --> | name=People's Republic of China <!--
 --> | flag alias=Flag of the People's Republic of China.svg}} =CN
 --> | flag alias=Flag of Australia.svg}} =AU
 --> | flag alias=Flag of Germany.svg}} =DE}
 --> | flag alias=Flag of Austria.svg}} =AT
 --> | flag alias=Flag of Italy.svg}} =IT
 --> | flag alias=Flag of Spain.svg}} =ES
 --> | flag alias=Flag of Japan.svg}} =JP
 --> | flag alias=Flag of the Netherlands.svg}} =NL
 --> =BR
 --> | flag alias=Flag of Sweden.svg}} =SE
 --> | alias=Czech Republic | name=Czech Republic<!--
 --> | flag alias=Flag of the Czech Republic.svg}} =CZ
 --> | flag alias=Flag of India.svg}} =IN-}}}
 --> | flag alias=Flag of Argentina.svg}} =AR
 --> | alias=New Zealand | name=New Zealand<!--
 --> | flag alias=Flag of New Zealand.svg}} =NZ
 --> | alias=Philippines | name=Philippines<!--
 --> | flag alias=Flag of Philippines.svg}} =PH
 --> | flag alias=Flag of Belgium (civil).svg}} =BE
 --> | flag alias=Flag of Russia.svg}} =RU
 --> | flag alias=Flag of Nepal.svg}} =NP
 --> | flag alias=Flag of Denmark.svg}} =DK
 --> | flag alias=Flag of Finland.svg}} =FI
 --> | flag alias=Flag of Hungary.svg}} =HU
 --> | alias=United Arab Emirates | name=United Arab Emirates<!--
 --> | flag alias=Flag of the United Arab Emirates.svg}} =AE
 --> | flag alias=Flag of Greece.svg}} =GR
 --> | flag alias=Flag of Albania.svg}} =AL
 --> | flag alias=Flag of Bulgaria.svg}} =BG
 --> | flag alias=Flag of Armenia.svg}} =AM
 --> | alias=Afghanistan | name=Afghanistan<!--
 --> | flag alias=Flag of Afghanistan.svg}} =AF
 --> | flag alias=Flag of Azerbaijan.svg}} =AZ
 --> | flag alias=Flag of Andorra.svg}} =AD
 --> | flag alias=Flag of Angola.svg}} =AO
 --> | flag alias=Flag of Korea.svg}} =KR
 --> | flag alias=Flag of Mexico.svg}} =MX
 --> | flag alias=Flag of Colombia.svg}} =CO
 --> | flag alias=Flag of Chile.svg}} =CL
 --> | alias=Antigua and Barbuda| name=Antigua and Barbuda<!--
 --> | flag alias=Flag of Antigua and Barbuda.svg}} =AG
 --> | flag alias=Flag of Croatia.svg}} =HR
 --> | alias=Netherlands Antilles |name=Netherlands Antilles<!--
 --> | flag alias=Flag of the Netherlands Antilles.svg}} =AN
 --> | alias=Curaçao | name=Curaçao<!--
 --> | flag alias=Flag of Curaçao.svg}} =AN
 --> | alias=South Africa | name=South Africa<!--
 --> | flag alias=Flag of South Africa.svg}} =ZA
 --> | alias=Bosnia and Herzegovina <!--
 --> | name=Bosnia and Herzegovina<!--
 --> | flag alias=Flag of Bosnia and Herzegovina.svg}} =BA
 --> | alias=Bangladesh | name=Bangladesh<!--
 --> | flag alias=Flag of Bangladesh.svg}} =BD
 --> | flag alias=Flag of Bahrain.svg}} =BH
 --> | flag alias=Flag of Burundi.svg}} =BI
 --> | flag alias=Flag of Benin.svg}} =BJ
 --> | flag alias=Flag of Bermuda.svg}} =BM
 --> | flag alias=Flag of Brunei.svg}} =BN
 --> | flag alias=Flag of Bolivia.svg}} =BO
 --> | flag alias=Flag of the Bahamas.svg}} =BS
 --> | flag alias=Flag of Bhutan.svg}} =BT
 --> | flag alias=Flag of Botswana.svg}} =BW
 --> | flag alias=Flag of Belarus.svg}} =BY
 --> | flag alias=Flag of Belize.svg}} =BZ
 --> | alias=Democratic Republic of the Congo <!--
 --> | name=Democratic Republic of the Congo <!--
 --> | flag alias= <!--
 --> Flag of the Democratic Republic of the Congo.svg}} =CD
 --> | alias=Central African Republic <!--
 --> | name=Central African Republic<!--
 --> | flag alias=Flag of the Central African Republic.svg}} =CF
 --> | alias=Republic of the Congo <!--
 --> | name=Republic of the Congo <!--
 --> | flag alias=Flag of the Republic of the Congo.svg}} =CG
 --> =CH<!--
 -->}|Schwyz|-SZ}}
 --> | alias=Côte d'Ivoire | name=Côte d'Ivoire<!--
 --> | flag alias=Flag of Côte d'Ivoire.svg}} =CI
 --> | alias=Cook Islands | name=Cook Islands<!--
 --> | flag alias=Flag of the Cook Islands.svg}} =CK
 --> | flag alias=Flag of Cameroon.svg}} =CM
 --> | flag alias=Flag of Costa Rica.svg}} =CR
 --> | flag alias=Flag of Cuba.svg}} =CU
 --> | flag alias=Flag of Cyprus.svg}} =CY
 --> | flag alias=Flag of Djibouti.svg}} =DJ
 --> | alias=Dominican Republic | name=Dominican Republic<!--
 --> | flag alias=Flag of the Dominican Republic.svg}} =DO
 --> | flag alias=Flag of Algeria.svg}} =DZ
 --> | flag alias=Flag of Ecuador.svg}} =EC
 --> | flag alias=Flag of Estonia.svg}} =EE
 --> | flag alias=Flag of Eritrea.svg}} =ER
 --> | flag alias=Flag of Ethiopia.svg}} =ET
 --> | flag alias=Flag of Fiji.svg}} =FJ
 --> | alias=Falkland Islands | name=Falkland Islands<!--
 --> | flag alias=Flag of the Falkland Islands.svg}} =FK
 --> | alias=Federated States of Micronesia <!--
 --> | name=Federated States of Micronesia <!--
 --> | flag alias=Flag of Federated States of Micronesia.svg}} =FM
 --> | flag alias=Flag of Gabon.svg}} =GA
 --> | flag alias=Flag of Grenada.svg}} =GD
 --> | flag alias=Flag of Georgia.svg}} =GE
 --> | flag alias=Flag of Guernsey.svg}} =GG
 --> | flag alias=Flag of Ghana.svg}} =GH
 --> | flag alias=Flag of Gibraltar.svg}} =GI
 --> | flag alias=Flag of Greenland.svg}} =GL
 --> | alias=Gambia | name=Gambia<!--
 --> | flag alias=Flag of Gambia.svg}} =GM
 --> | flag alias=Flag of Guinea.svg}} =GN
 --> | flag alias=Flag of Guadeloupe.svg}} =GP
 --> | flag alias=Flag of Guatemala.svg}} =GT
 --> | flag alias=Flag of Guam.svg}} =GU
 --> | flag alias=Flag of Guyana.svg}} =GY
 --> | flag alias=Flag of Hong Kong.svg}} =HK
 --> | flag alias=Flag of Honduras.svg}} =HN
 --> | flag alias=Flag of Haiti.svg}} =HT
 --> | flag alias=Flag of Indonesia.svg}} =ID
 --> | alias=Republic of Ireland | name=Ireland<!--
 --> | flag alias=Flag of Ireland.svg}} =IE
 --> | flag alias=Flag of Israel.svg}} =IL
 --> | flag alias=Flag of Egypt.svg}} =EG
 --> | flag alias=Flag of Iraq.svg}} =IQ
 --> | flag alias=Flag of Iran.svg}} =IR
 --> | flag alias=Flag of Iceland.svg}} =IS
 --> | flag alias=Flag of Jersey.svg}} =JE
 --> | alias=Jamaica | name=Jamaica <!--
 --> | flag alias=Flag of Jamaica.svg}} =JM
 --> | flag alias=Flag of Jordan.svg}} =JO
 --> | flag alias=Flag of Kenya.svg}} =KE
 --> | alias=Kyrgyzstan | name=Kyrgyzstan<!--
 --> | flag alias=Flag of Kyrgyzstan.svg}} =KG
 --> | flag alias=Flag of Cambodia.svg}} =KH
 --> | flag alias=Flag of Comoros.svg}} =KM
 --> | alias=South Korea | name=South Korea<!--
 --> | flag alias=Flag of South Korea.svg}} | | | | =KR
 --> | alias=North Korea | name=North Korea<!--
 --> | flag alias=Flag of North Korea.svg}} | | | | =KP
 --> | flag alias=Flag of Kuwait.svg}} =KW
 --> | alias=Cayman Islands | name=Cayman Islands<!--
 --> | flag alias=Flag of Cayman Islands.svg}} =KY
 --> | alias=Kazakhstan | name=Kazakhstan<!--
 --> | flag alias=Flag of Kazakhstan.svg}} =KZ
 --> | flag alias=Flag of Laos.svg}} =LA
 --> | flag alias=Flag of Lebanon.svg}} =LB
 --> | alias=Liechtenstein | name=Liechtenstein<!--
 --> | flag alias=Flag of Liechtenstein.svg}} =LI
 --> | alias=Sri Lanka | name=Sri Lanka<!--
 --> | flag alias=Flag of Sri Lanka.svg}} =LK
 --> | flag alias=Flag of Liberia.svg}} =LR
 --> | flag alias=Flag of Lesotho.svg}} =LS
 --> | alias=Lithuania | name=Lithuania<!--
 --> | flag alias=Flag of Lithuania.svg}} =LT
 --> | alias=Luxembourg | name=Luxembourg<!--
 --> | flag alias=Flag of Luxembourg.svg}} =LU
 --> | flag alias=Flag of Latvia.svg}} =LV
 --> | flag alias=Flag of Libya.svg}} =LY
 --> | flag alias=Flag of Morocco.svg}} =MA
 --> | flag alias=Flag of Monaco.svg}} =MC
 --> | flag alias=Flag of Moldova.svg}} =MD
 --> | alias=Montenegro | name=Montenegro<!--
 --> | flag alias=Flag of Montenegro.svg}} =ME
 --> |alias=Saint Martin | name=Saint Martin<!--
 --> | flag alias=Flag of Saint Martin.svg}} =MF
 --> | alias=Madagascar | name=Madagascar<!--
 --> | flag alias=Flag of Madagascar.svg}} =MG
 --> | alias=Macedonia | name=Macedonia <!--
 --> | flag alias=Flag of Macedonia .svg}} =MK
 --> | flag alias=Flag of Mali.svg}} =ML
 --> | flag alias=Flag of Myanmar.svg}} =MM
 --> | flag alias=Flag of Mongolia.svg}} =MN
 --> | flag alias=Flag of Macau.svg}} =MO
 --> | alias=Northern Mariana Islands <!--
 --> | name=Northern Mariana Islands <!--
 --> | flag alias=Flag of Northern Mariana Islands.svg}} =MP
 --> | alias=Martinique | name=Martinique<!--
 --> | flag alias=Flag of Martinique.svg}} =MQ
 --> | alias=Mauritania| name=Mauritania<!--
 --> | flag alias=Flag of Mauritania.svg}} =MR
 --> | flag alias=Flag of Malta.svg}} =MT
 --> | flag alias=Flag of Maldives.svg}} =MV
 --> | flag alias=Flag of Malawi.svg}} =MW
 --> | flag alias=Flag of Malaysia.svg}} MY
 --> | alias=Mozambique | name=Mozambique<!--
 --> | flag alias=Flag of Mozambique.svg}} =MZ
 --> | flag alias=Flag of Namibia.svg}} =NA
 --> | flag alias=Flag of Niger.svg}} =NE
 --> | flag alias=Flag of Nigeria.svg}} =NG
 --> | alias=Nicaragua | name=Nicaragua<!--
 --> | flag alias=Flag of Nicaragua.svg}} =NI
 --> | flag alias=Flag of Norway.svg}} =NO
 --> | flag alias=Flag of Nauru.svg}} =NR
 --> | flag alias=Flag of Oman.svg}} =OM
 --> | flag alias=Flag of Panama.svg}} =PA
 --> | flag alias=Flag of Peru.svg}} =PE
 --> | flag alias=Flag of Pakistan.svg}} =PK
 --> | alias=Puerto Rico | name=Puerto Rico<!--
 --> | flag alias=Flag of Puerto Rico.svg}} =PR
 --> | flag alias=Flag of Palestine.svg}} =PS
 --> | flag alias=Flag of Portugal.svg}} =PT
 --> | flag alias=Flag of Palau.svg}} =PW
 --> | flag alias=Flag of Paraguay.svg}} =PY
 --> | flag alias=Flag of Qatar.svg}} =QA
 --> | flag alias=Flag of Romania.svg}} =RO
 --> | flag alias=Flag of Serbia.svg}} =RS
 --> | flag alias=Flag of Rwanda.svg}} =RW
 --> | alias=Saudi Arabia | name=Saudi Arabia<!--
 --> | flag alias=Flag of Saudi Arabia.svg}} =SA
 --> | alias=Solomon Islands | name=Solomon Islands<!--
 --> | flag alias=Flag of the Solomon Islands.svg}} =SB
 --> | alias=Seychelles| name=Seychelles<!--
 --> | flag alias=Flag of Seychelles.svg}} =SC
 --> | flag alias=Flag of Sudan.svg}} =SD
 --> | flag alias=Flag of Singapore.svg}} =SG
 --> | alias=Saint Helena | name=Saint Helena<!--
 --> | flag alias=Flag of Saint Helena.svg}} =SH
 --> | flag alias=Flag of Slovenia.svg}} =SI
 --> | alias=Sierra Leone | name=Sierra Leone<!--
 --> | flag alias=Flag of Sierra Leone.svg}} =SL
 --> | alias=San Marino | name=San Marino<!--
 --> | flag alias=Flag of San Marino.svg}} =SM
 --> | flag alias=Flag of Senegal.svg}} =SN
 --> | flag alias=Flag of Somalia.svg}} =SO
 --> | flag alias=Flag of Suriname.svg}} =SR
 --> | alias=El Salvador | name=El Salvador <!--
 --> | flag alias=Flag of El Salvador.svg}} =SV
 --> | flag alias=Flag of Syria.svg}} =SY
 --> | flag alias=Flag of Swaziland.svg}} =SZ
 --> | flag alias=Flag of Chad.svg}} =TD
 --> | flag alias=Flag of Togo.svg}} =TG
 --> | flag alias=Flag of Thailand.svg}} =TH
 --> | alias=Tajikistan | name=Tajikistan<!--
 --> | flag alias=Flag of Tajikistan.svg}} =TJ
 --> | flag alias=Flag of Tokelau.svg}} =TK
 --> | alias=Turkmenistan | name=Turkmenistan<!--
 --> | flag alias=Flag of Turkmenistan.svg}} =TM
 --> | flag alias=Flag of Tunisia.svg}} =TN
 --> | flag alias=Flag of Tonga.svg}} =TO
 --> | flag alias=Flag of Turkey.svg}} =TR
 --> | =TT
 --> | flag alias=Flag of Tuvalu.svg}} =TV
 --> | alias=Republic of China | name=Republic of China<!--
 --> | flag alias=Flag of the Republic of China.svg}} =TW
 --> | alias=Republic of China | name=Taiwan <!--
 --> | flag alias=Flag of the Republic of China.svg}} =TW
 --> | flag alias=Flag of Tanzania.svg}} =TZ
 --> | flag alias=Flag of Ukraine.svg}} =UA
 --> | flag alias=Flag of Uganda.svg}} =UG
 --> | flag alias=Flag of Uruguay.svg}} =UY
 --> | alias=Uzbekistan | name=Uzbekistan<!--
 --> | flag alias=Flag of Uzbekistan.svg}} =UZ
 --> | alias=Vatican City | name=Vatican City <!--
 --> | flag alias=Flag of the Vatican City.svg}} = VA
 -->| alias=Saint Vincent and the Grenadines <!--
 -->| name=Saint Vincent and the Grenadines <!--
 -->|flag alias=Flag of Saint Vincent and the Grenadines.svg}}=VC
 --> | flag alias=Flag of Venezuela.svg}} =VE
 -->| alias=British Virgin Islands <!--
 -->| name=British Virgin Islands <!--
 -->| flag alias=Flag of the British Virgin Islands.svg}}=VG
 -->| alias=United States Virgin Islands <!--
 -->| name=United States Virgin Islands <!--
 -->| flag alias=Flag of the United States Virgin Islands.svg}}=VI
 --> | flag alias=Flag of Vietnam.svg}} =VN
 --> | flag alias=Flag of Vanuatu.svg}} =VU
 --> | flag alias=Flag of Samoa.svg}} =WS
 --> | flag alias=Flag of Yemen.svg}} =YE
 --> | flag alias=Flag of Mayotte.svg}} =YT
 --> | flag alias=Flag of Zambia.svg}} =ZM
 --> | flag alias=Flag of Zimbabwe.svg}} =ZW
 --> | flag alias=Flag of Anguilla.svg}} =AI
 --> | flag alias=Flag of Slovakia.svg}} =SK
 --> | flag alias=Flag of Aruba.svg}} =AW
 --> | alias=American Samoa | name=American Samoa<!--
 --> | flag alias=Flag of American Samoa.svg}} =AS
 --> | alias=Burkina Faso | name=Burkina Faso<!--
 --> | flag alias=Flag of Burkina Faso.svg}} =BF
 --> | flag alias=Flag of Barbados.svg}} =BB
 --> | alias=Antarctica | name=Antarctica<!--
 --> | flag alias=Flag of Antarctica.svg}} =AQ
--NOTES:
--
-- A1: This template is used to find a 2-letter country
-- code (plus 2-letter region code) by matching each
-- country-flag spanned image+wikilink. However, the
-- original implementation transcluded over 560 flag
-- or country-data templates, so the code has been
-- simplified to omit specialized flag templates and
-- omit rare flags not used by a caller page.
--
-- D2: The flag+wikilink data can be generated for each
-- country by which shows:
-- XXX
-- Directly using template can bypass
-- other country templates, and avoid hundreds in total,
-- but XXX must be repeated in name, alias & flag alias.
--
-- F3: The flag+wikilink combinations were originally
-- generated by the 3-letter templates, such as 
-- for the Germany flag+Germany. However, in most
-- cases, using template will generate the same
-- data and match as identical: =
-- Unfortunately, uses 
-- so for all flags, hundreds of "Country data XXX"
-- templates were also being transcluded. Eventually,
-- to use the fewest templates, use :
-- 
-- Although country name is repeated 3 times, it avoids
-- , & 
-- avoiding 3 templates for each nation.
--
-- Q4: Among the many quirks of images, an image name
-- using blanks will not match a name with underscores
-- or underbars ("_"), although they display the same.
--
-- S4: The top 40 most-referenced nations have been
-- sorted into order, to match as quickly as possible
-- in the #switch logic.
--
-- W5: The following are unusual items:
-- Switzerland=CH but set "Schwyz" as CH-SZ.
-- Flags of groups add "the" but not in Fed...Micronesia.
-- Flag of Wales has "2" suffix: Flag of Wales 2.svg
-- Flag of Belgium: Flag of Belgium (civil).svg
-- Flag of Switzerland uses not {Country flag2}.
-- BEWARE: Flag name underbars won't match spaced names.
--
-- For simplicity, not all flags have been added into
-- the template, and some nation flags will not match.
--
--HISTORY:
--08Mar09 Created to get 2-letter codes by flag-code templates.
--24Mar10 Added HISTORY comments to log major changes.
--25Mar10 Redone to omit most 3-letter templates {DEU},{VAT}...
--25Mar10 Redone to omit 562 subtemplates of nation data/flags.
--25Mar10 Re-added Europe/Africa/Asia flags as {Country flag2}.
--25Mar10 Added internal NOTES comments to explain template coding.
--25Mar10 Fixed Switzerland=CH (not SZ), canton Schwyz as CH-SZ.
--27Mar10 Sorted 40 most-referenced nations to match quickly.
--
-->