Problem/Motivation

No json.zip file is served anymore at the page http://cldr.unicode.org/index/downloads in contrast to the usage text inside the core/scripts/update-countries.sh file. The patch aims to address this discrepancy.

Steps to reproduce

1. Visit http://cldr.unicode.org/index/downloads.
2. Observe that no json.zip file is available for download.
3. Review the usage text in core/scripts/update-countries.sh.

Proposed resolution

Update the text updating the list of files to download and the instructions in core/scripts/update-countries.sh.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

This patch corrects the data retrieval process in core/scripts/update-countries.sh to reflect the changes in CLDR data availability. Users are now instructed to download territories.json from the main branch of the repository https://github.com/unicode-org/cldr-json.

Issue fork drupal-3087630

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sahal_va created an issue. See original summary.

sahal_va’s picture

sahal_va’s picture

Status: Active » Needs review

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

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

sahal_va’s picture

Assigned: sahal_va » Unassigned
abhijith s’s picture

Patch #2 cant be applied.Needs reroll.

-congo-kinshasa-3087630-1.patch
Checking patch core/lib/Drupal/Core/Locale/CountryManager.php...
error: while searching for:
      'BZ' => t('Belize'),
      'CA' => t('Canada'),
      'CC' => t('Cocos [Keeling] Islands'),
      'CD' => t('Congo - Kinshasa'),
      'CF' => t('Central African Republic'),
      'CG' => t('Congo - Brazzaville'),
      'CH' => t('Switzerland'),

error: patch failed: core/lib/Drupal/Core/Locale/CountryManager.php:79
error: core/lib/Drupal/Core/Locale/CountryManager.php: patch does not apply
abhijith s’s picture

StatusFileSize
new621 bytes

Rerolled patch #2 .Please check.

cosmicdreams’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

jungle’s picture

> The Democratic Republic of the Congo (DRC) (About this soundpronunciation (help·info) French: République démocratique du Congo (RDC) [kɔ̃ɡo]), also known as Congo-Kinshasa

-- https://en.wikipedia.org/wiki/Democratic_Republic_of_the_Congo,

> ISO 3166 code: CD

-- https://en.wikipedia.org/wiki/ISO_3166-2:CD

Per Wikipedia, the change of the name is correct, and the code: CD is unchanged. RTBC+1, also queued tests against 9.2.x, 9.1.x, and 9.0.x branches.

quietone’s picture

I learned recently that Drupal uses CLDR data for the country list. Is this change in accordance with that?

See #1938892: Switch from ISO-3166-1 country data to CLDR unicode data

jungle’s picture

Version: 8.9.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new200.43 KB

Thanks @quietone for sharing the link.

The CLDR data from the latest release of https://github.com/unicode-org/cldr-json/tags still lists the country as Congo - Kinshasa, but looked into the territories.json file inside the folder cldr-localenames-full/main/en, there is an entry "CD-alt-variant": "Congo (DRC)",

On macOS Big Sur (Version 11.3), it lists the country as Congo - Kinshasa too, see the screenshot attached.

The CLDR data should be the source to update the country data and the community agreed before.

So I would suggest updating the script core/scripts/update-countries.sh:

  • To use the entry "CD-alt-variant": "Congo (DRC)", instead, per the wiki page mentioned in #10, it looks like more applicable.
  • Update the usage part.

    - Choose the latest release data from http://cldr.unicode.org/index/downloads
    and download the json.zip file.
    - Unzip the json.zip file and place the main/en/territories.json in the
    Drupal root directory.
    - Run this script.

    The json data link should be download from https://github.com/unicode-org/cldr-json, and the file to place is cldr-localenames-full/main/en/territories.json -- failed to find the json data on http://cldr.unicode.org/index/downloads

jungle’s picture

Title: Changing the name of country 'congo-kinshasa' to 'Democratic Republic of the Congo' » Changing the name of country 'Congo - Kinshasa' to 'Congo (DRC)'
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new1.84 KB

Updated the script core/scripts/update-countries.sh and regenerated the file core/lib/Drupal/Core/Locale/CountryManager.php with it.

longwave’s picture

There are some notes on alternate country names including Congo - Kinshasa at http://cldr.unicode.org/translation/displaynames/country-names

I think there is an issue here in that if we are to change "Congo - Kinshasa" to "Congo (DRC)" then we should also change "Congo - Brazzaville" to "Congo (Republic)" at the same time. But we also need a good reason to change these away from the defaults; we try to be as politically neutral as possible and so we use the CLDR default names for all countries - see also the note on the CLDR page that "The ISO names and the "official" names are often not necessarily the best ones."

jungle’s picture

StatusFileSize
new1.11 KB

Then, only updated the usage part in core/scripts/update-countries.sh.

For the policy of using alt ones, we need to find the opened issue if it exists or file a new one, probably.

jungle’s picture

Title: Changing the name of country 'Congo - Kinshasa' to 'Congo (DRC)' » Update the usage part in core/scripts/update-countries.sh

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mitthukumawat’s picture

Patch #13 and #15 applied cleanly for me.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Applied #8 patch applied successfully
core/lib/Drupal/Core/Locale/CountryManager.php has been modified

Thanks for the patch

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

nikhil_110’s picture

StatusFileSize
new1.1 KB

Attached patch against Drupal 10.1.x

Patch #15 is not applied for Drupal 10.1.x so Inter-diff file is not added.

Checking patch core/misc/cspell/dictionary.txt...
error: while searching for:
llamma
lnumber
localemark
localetranslatedirty
localizable
localpath

error: patch failed: core/misc/cspell/dictionary.txt:874
error: core/misc/cspell/dictionary.txt: patch does not apply
Checking patch core/scripts/update-countries.sh...

nikhil_110’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

This needs an issue summary for what is being addressed here. Maybe even a title update to be more clear.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

makbay’s picture

Title: Update the usage part in core/scripts/update-countries.sh » Update the obsolete usage text inside core/scripts/update-countries.sh
Issue summary: View changes

makbay’s picture

I have created a similar issue to the original issue and noticed the change of CLDR json publishment there:

https://www.drupal.org/project/drupal/issues/3395852#comment-15285830

This is the most recent way to get the json:

- Choose the main branch on repository https://github.com/unicode-org/cldr-json
and download the territories.json file inside the directory cldr-json/cldr-localenames-full/main/en
e.g. https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-locale....

makbay’s picture

Issue summary: View changes
makbay’s picture

Status: Needs work » Needs review
Issue tags: -Needs issue summary update

MR created, tests passed.

smustgrave’s picture

It’s better if the issue summary could be updated to the issue template just fyi

makbay’s picture

Issue summary: View changes

Issue summary is updated to the issue template.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

looks much better to me thanks!

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Added some feedback to the MR, hiding the patches as they are not relevant.

makbay’s picture

Status: Needs work » Reviewed & tested by the community

Suggestions are applied.

quietone’s picture

Nice to see this script being updated.

I read the issue summary, which clearly states the problem and solution, and comments and did not find any unanswered questions or work to do. The only thing I see is that the well written release note snippet isn't needed on this issue. But it good practice to write one! Release note snippets will go on the release notes which don't need to mention changes to internal scripts. You can see the types of changes that are put in the release notes by reading the 10.1.0 release notes.

Leaving at RTBC

  • quietone committed 4c1dbc92 on 11.x
    Issue #3087630 by makbay, jungle, sahal_va, Abhijith S, Nikhil_110,...
quietone’s picture

Status: Reviewed & tested by the community » Fixed

Good to see the instructions updated. Thanks!

Committed 4c1dbc9 and pushed to 11.x.

quietone’s picture

Issue tags: -country name, -core, -locale

I meant to update the tags according to the guidelines.

Status: Fixed » Closed (fixed)

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