[6.x] Replace currency and country dictionaries with Symfony Intl CLDR data#14527
Closed
jasonvarga wants to merge 2 commits into6.xfrom
Closed
[6.x] Replace currency and country dictionaries with Symfony Intl CLDR data#14527jasonvarga wants to merge 2 commits into6.xfrom
jasonvarga wants to merge 2 commits into6.xfrom
Conversation
The Currencies dictionary now builds its item list from Symfony\Component\Intl\Currencies, keeping the same item shape and option labels. Hand-maintained lang dictionary-currencies files are removed, and the translator script no longer treats that file as manual. Tests assert stable English names where appropriate and tighten search to prove filtering returns a strict subset of options. Made-with: Cursor
The Countries dictionary now pulls names and alpha-3 codes from Symfony\Component\Intl\Countries, with a small subregion => [iso2, ...] map declared on the class to preserve the region filter config and the subregion/region item fields. Flag emojis are derived from the alpha-2 code via Unicode regional indicator math. Sorting uses Str::ascii() so accented names (Åland, Côte d'Ivoire, Réunion) collate alongside their ASCII counterparts instead of landing after Z. The lang/*/dictionary-countries.php files keep their regions/subregions labels but drop the 250 hand-translated country names per locale. Antarctica, Bouvet, and Heard & McDonald no longer have a region assignment, and the polar region is removed from the filter options. Tests are reshaped in the Currencies style: assert stable entries and a strict subset for search. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
This requires the intl extension which we can't introduce mid-way through 6.x. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Symfony\Component\Intl\Currencies, keeping the same item shape and option labels. Hand-maintainedlang/*/dictionary-currencies.phpfiles are removed, and the translator script no longer treats that file as manual.Symfony\Component\Intl\Countries. A smallsubregion => [iso2, …]map declared on the class preserves the region filter config and the subregion/region item fields. Flag emojis are derived from the alpha-2 code via Unicode regional indicator math. The 250 hand-translated country names per locale are removed fromlang/*/dictionary-countries.php; the regions/subregions labels are kept.Str::ascii()as the sort key, so accented names (Åland, Côte d'Ivoire, Réunion, São Tomé) collate alongside their ASCII counterparts rather than landing after Z under byte-wise comparison.polarregion is removed from the filter options. Kosovo is dropped since it isn't in Symfony's list.Str::ascii()-aware subset assertions for search, and exercise locale-aware naming viaapp()->setLocale('de').Notable label changes
Because CLDR is the source of truth, English names shift slightly toward standardized Unicode spellings — e.g. "Aland Islands" → "Åland Islands", "Ivory Coast" → "Côte d'Ivoire", "Virgin Islands (US)" → "U.S. Virgin Islands", "Antigua And Barbuda" → "Antigua & Barbuda", "Macau S.A.R." → "Macao SAR China".
Test plan
./vendor/bin/phpunit tests/Dictionaries/passes./vendor/bin/phpunit tests/Fieldtypes/DictionaryTest.php tests/Fieldtypes/DictionaryFieldsTest.phppasses./vendor/bin/phpunit tests/Feature/GraphQL/Fieldtypes/DictionaryFieldtypeTest.php tests/Tags/Dictionary/DictionaryTagTest.phppasses./vendor/bin/pintclean on changed files