In #1938892: Switch from ISO-3166-1 country data to CLDR unicode data it was attempted to make the country core list match the CLDR Unicode data, however two codes are still wrong:

-      'AN' => t('Netherlands Antilles'),
-      'QO' => t('Outlying Oceania'),

Here is the latest list of territory data from CLDR:
http://www.unicode.org/cldr/charts/latest/supplemental/territory_informa...

'AN' is a former ISO code not any longer in use.
'QO' is an extra "Territory Containment" (groups of territories) for territories that are not included in other territory containments such as Eastern Africa, Caribbean, Central Asia, etc:
http://www.unicode.org/cldr/charts/latest/supplemental/territory_contain...
It is listed as a "private use subtag" in 'Core Specification':
http://cldr.unicode.org/core-spec

These names have been updated since last time Drupal imported territory data from CLDR #1938892: Switch from ISO-3166-1 country data to CLDR unicode data (some minor simplifications)

-      'AG' => t('Antigua and Barbuda'),
+      'AG' => t('Antigua & Barbuda'),
-      'BA' => t('Bosnia and Herzegovina'),
+      'BA' => t('Bosnia & Herzegovina'),
-      'BL' => t('Saint Barthélemy'),
+      'BL' => t('St. Barthélemy'),
-      'CC' => t('Cocos [Keeling] Islands'),
+      'CC' => t('Cocos (Keeling) Islands'),
-      'EA' => t('Ceuta and Melilla'),
+      'EA' => t('Ceuta & Melilla'),
-      'GS' => t('South Georgia and the South Sandwich Islands'),
+      'GS' => t('South Georgia & South Sandwich Islands'),
-      'HM' => t('Heard Island and McDonald Islands'),
+      'HM' => t('Heard & McDonald Islands'),
-      'KN' => t('Saint Kitts and Nevis'),
+      'KN' => t('St. Kitts & Nevis'),
-      'LC' => t('Saint Lucia'),
+      'LC' => t('St. Lucia'),
-      'MF' => t('Saint Martin'),
+      'MF' => t('St. Martin'),
-      'MM' => t('Myanmar [Burma]'),
+      'MM' => t('Myanmar (Burma)'),
-      'PM' => t('Saint Pierre and Miquelon'),
+      'PM' => t('St. Pierre & Miquelon'),
-      'SH' => t('Saint Helena'),
+      'SH' => t('St. Helena'),
-      'SJ' => t('Svalbard and Jan Mayen'),
+      'SJ' => t('Svalbard & Jan Mayen'),
-      'ST' => t('São Tomé and Príncipe'),
+      'ST' => t('São Tomé & Príncipe'),
-      'TC' => t('Turks and Caicos Islands'),
+      'TC' => t('Turks & Caicos Islands'),
-      'TT' => t('Trinidad and Tobago'),
+      'TT' => t('Trinidad & Tobago'),
-      'VC' => t('Saint Vincent and the Grenadines'),
+      'VC' => t('St. Vincent & Grenadines'),
-      'WF' => t('Wallis and Futuna'),
+      'WF' => t('Wallis & Futuna'),

In CLDR v.28 there are also alternative "short" names for some territories (that CLDR also provide translations for) inside 'common/main/en.xml' :
http://cldr.unicode.org/index/downloads/cldr-28

If we would like to go for the short name versions we would also get these changes;

-      'BA' => t('Bosnia and Herzegovina'),
+      'BA' => t('Bosnia'),
-      'GB' => t('United Kingdom'),
+      'GB' => t('UK'),
-      'HK' => t('Hong Kong SAR China'),
+      'HK' => t('Hong Kong'),
-      'VC' => t('Myanmar [Burma]'),
+      'VC' => t('Myanmar'),
-      'MO' => t('Macau SAR China'),
+      'MO' => t('Macau'),
-      'PS' => t('Palestinian Territories'),
+      'PS' => t('Palestine'),
-      'US' => t('United States'),
+      'US' => t('US'),

I guess then the names would become more user friendly and aligned with the names people mostly use in everyday informal language. US and UK end up as abbreviations though, not sure what people mostly look for in the select list from these countries? Other changes might be political sensitive for some, however for all other names a simple form is used, and official names are ignored, so not sure why these specific cases should be treated differently.

EDIT: Wikipedia keeps a list of sovereign countries with those not recognized by other states. Useful to at least identify places of conflict.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

matsbla created an issue. See original summary.

matsbla’s picture

bojanz’s picture

Title: Clean up country core data in CountryManager::getStandardList() to match CLDR unicode data » Update the country list to match latest CLDR
Version: 8.0.0-rc1 » 8.1.x-dev
Category: Bug report » Task
Priority: Major » Normal
Status: Needs review » Needs work

We should not be using the short names.

We need a patch that updates the country list (make-country-core-names-match-cldr.patch + make-country-core-list-match-cldr.patch) and we need to update update-countries.sh for the list of ignored countries.

Current update-countries.sh code:

  $exclude_codes = array(
    'EU', // The European Union is not a country.
    'ZZ', // Don't allow "Unknown Region".
  );

Needed update-countries.sh code, copied from the commerceguys/intl library:

  $exclude_codes = array(
   'AN', // Netherlands Antilles, no longer exists.
    'BV', 'HM', 'CP', // Uninhabited islands.
    'EU', 'QO', // European Union, Outlying Oceania. Not countries.
    'ZZ', // Unknown region
  );

(Note that my suggested improvement also removes BV, HM, CP).

mgifford’s picture

Issue summary: View changes

Adding acronym & also link to Wikipedia.

mgifford’s picture

Issue summary: View changes
pguillard’s picture

Status: Needs work » Needs review
FileSize
6.92 KB

I put into one patch make-country-core-names-match-cldr.patch, make-country-core-list-match-cldr.patch and the changes to update-countries.sh code.

matsbla’s picture

Status: Needs review » Reviewed & tested by the community

Tested and looked over, looks good!

catch’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/lib/Drupal/Core/Locale/CountryManager.php
@@ -47,11 +47,10 @@ public static function getStandardList() {
-      'AN' => t('Netherlands Antilles'),

Not sure we can remove a country code in a minor release. What exactly happens if this is already selected?

bojanz’s picture

Also, HM is still in the list despite being added to the script.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Liam Morland’s picture

Patch generated from today's CLDR using update-countries.sh. This patch updates names. It does not add or remove any codes.

The official CLDR JSON list of countries is now here:

https://github.com/unicode-cldr/cldr-localenames-full/blob/master/main/e...

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.