Problem/Motivation

Unicode CLDR Version 35 Language/Locale Data Released

We shall update the codes to the latest data (35.0.0)

Ref: http://blog.unicode.org/2019/03/unicode-cldr-version-35-languagelocale.html

Proposed resolution

Update CountryManager.php to latest data

Ref: https://raw.githubusercontent.com/unicode-cldr/cldr-localenames-full/mas...

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

@todo

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Joseph Zhao created an issue. See original summary.

pandaski’s picture

core/scripts/update-countries.sh is being used for creating the patch for 8.8.x

pandaski’s picture

Component: base system » locale.module
Pancho’s picture

Status: Needs review » Needs work

Quite some changes this time. While most are fine, these aren't and have to be filtered out:

+      'EZ' => t('Eurozone'),
+      'UN' => t('United Nations'),
+      'XA' => t('Pseudo-Accents'),
+      'XB' => t('Pseudo-Bidi'),
cilefen’s picture

Let’s update core/scripts/update-countries.sh to filter standard exclusions, which evidently exist.

cilefen’s picture

I suppose we should be updating the countries in every minor release and we need a way to remind ourselves.

pandaski’s picture

Status: Needs work » Needs review
FileSize
6.83 KB
1.33 KB

Thanks for the review @Pancho

In the new patch #7 also updated the `update-countries.sh` file so we can skip the codes while running this script.

  // Skip any codes we wish to exclude from our country list.
  $exclude_codes = [
    // The European Union is not a country.
    'EU',
    // The Eurozone is not a country.
    'EZ',
    // The United Nations is not a country.
    'UN',
    'XA',
    'XB',
    // Don't allow "Unknown Region".
    'ZZ',
  ];

tim.plunkett’s picture

pandaski’s picture

FileSize
9.58 KB

Attach `territories.txt` file which is the source file for `core/scripts/update-countries.sh`

pandaski’s picture

Please review it, thanks

tstoeckler’s picture

Title: Update CLDR codes in CountryManager.php to latest data (35.0.0) » Update CLDR codes in CountryManager.php to latest data (35.1.0)

Verified that the changes in CountryManager.php are reproducable. I tried both 35.0 and 35.1 which has been released in the meantime, and there were no changes. (Changing title accordingly)

The changes in the update-countries.sh script also look good. I wonder, though if we could add some more comments to the newly added lines, i.e.

// "Pseudo-Accents" is not a country.
...
// "Pseudo-Bidi" is not a country.
...

Also maybe a link to the official reference would be helpful, I think, because these codes are somewhat obscure and not super easy to find. http://unicode.org/reports/tr35/#unicode_region_subtag_validity was the best link I could find, but maybe there's something better than that.

pandaski’s picture

Please check the following updates in the new patch:

  • Add comment lines regarding "Pseudo-Accents" and "Pseudo-Bidi"

Personally, I cannot think many to improve this patch before a rethink of how we want to manage the countries in an innovated way (could take a while). In our current implementations, this is one of the best approaches to get the list updated and respect CLDR changes with local equivalents of “North Macedonia” (MK) and “Eswatini” (SZ) etc.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Looks good to me.

  • Gábor Hojtsy committed e85067b on 8.8.x
    Issue #3044261 by Joseph Zhao, cilefen, tstoeckler, Pancho, gnindl:...
Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Superb, thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.