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.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3087630
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:
- 3087630-update-the-obsolete
changes, plain diff MR !5458
Comments
Comment #2
sahal_va commentedComment #3
sahal_va commentedComment #6
sahal_va commentedComment #7
abhijith s commentedPatch #2 cant be applied.Needs reroll.
Comment #8
abhijith s commentedRerolled patch #2 .Please check.
Comment #9
cosmicdreams commentedLooks good.
Comment #10
jungle> 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.
Comment #11
quietone commentedI 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
Comment #12
jungleThanks @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:
"CD-alt-variant": "Congo (DRC)",instead, per the wiki page mentioned in #10, it looks like more applicable.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/downloadsComment #13
jungleUpdated the script core/scripts/update-countries.sh and regenerated the file
core/lib/Drupal/Core/Locale/CountryManager.phpwith it.Comment #14
longwaveThere 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."
Comment #15
jungleThen, 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.
Comment #16
jungleComment #18
mitthukumawat commentedPatch #13 and #15 applied cleanly for me.
Comment #20
vikashsoni commentedApplied #8 patch applied successfully
core/lib/Drupal/Core/Locale/CountryManager.php has been modified
Thanks for the patch
Comment #23
needs-review-queue-bot commentedThe 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.
Comment #24
nikhil_110 commentedAttached patch against Drupal 10.1.x
Patch #15 is not applied for Drupal 10.1.x so Inter-diff file is not added.
Comment #25
nikhil_110 commentedComment #26
smustgrave commentedThis needs an issue summary for what is being addressed here. Maybe even a title update to be more clear.
Comment #28
makbay commentedComment #30
makbay commentedI 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:
Comment #31
makbay commentedComment #32
makbay commentedMR created, tests passed.
Comment #33
smustgrave commentedIt’s better if the issue summary could be updated to the issue template just fyi
Comment #34
makbay commentedIssue summary is updated to the issue template.
Comment #35
smustgrave commentedlooks much better to me thanks!
Comment #36
longwaveAdded some feedback to the MR, hiding the patches as they are not relevant.
Comment #37
makbay commentedSuggestions are applied.
Comment #38
quietone commentedNice 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
Comment #40
quietone commentedGood to see the instructions updated. Thanks!
Committed 4c1dbc9 and pushed to 11.x.
Comment #42
quietone commentedI meant to update the tags according to the guidelines.