-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Missing zh_TW.json in Intl/Resources/data/regions #21457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In the ICU data,
Maybe there's some issue with aliases? Let's ask to our ICU/Intl expert @jakzal. Thanks! |
@jakzal Any chance you can help here? :) |
@lanphy what's the problem you're experiencing? Would you be able to write a snippet of code reproducing the issue? Is the result of the script below not what you expect? <?php
// intl.php
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\Intl\Intl;
\Locale::setDefault('zh_TW');
$countries = Intl::getRegionBundle()->getCountryNames();
var_dump($countries); |
Hi, I'm not experiencing an "issue", I'm just notifing that there is a missing file in Symfony package (zh_TW.json), that I have added as attached file here, and offer my suggest to add it in the package. |
We can't just upload the file you sent us, as all of these files are generated out of data provided by ICU. This is why I'm asking if there's any issue you've experienced. Is the list of countries wrong for |
@lanphy the json files are not meant to be accessed directly. They are used as source by the API of the component. So any fix should be related to an issue with the component API, not just related to looking at the list of files |
I see. What I experienced is : there is not traditionnal Chinese (Chinese Taiwan) language for the list of countries, only a simplified version one. |
@lanphy which list are you talking about exactly? |
The CountryType Field. |
I just verified and Taiwan is on the list of countries:
|
No, I mean there isn't "Traditionnal Chinese" in the list of translated languages. |
I can see it on the list coming from
or with
|
Yes, but the content seems missing. |
@lanphy you really need to be more specific. What are you trying to do? What's the actual and the expected behaviour? |
When I want to display the list of countries with CountryType in zh_Hant_TW language, it only displays zh_Hant. So I looked into the library, and as I guessed, there is missing all the zh_Hant_TW labels for the list of countries. |
Ok, could you show me an example of the actual value vs the expected value in the country select? A single key and a single value will do. For example: I see "a => b", but I'd like to see "c => d". |
Instead of "AD": "安道爾", I get "AD": "安道尔". |
If you don't see any issue, it might be my implementation which is not correct. |
@lanphy thanks, with your help I managed to reproduce the issue. For |
@jakzal Do you have time to check if the issue is on our side? Thanks. |
Just did some more debugging and looks like it's on our side. I'm looking into the best way to fix it. |
…zal) This PR was squashed before being merged into the 2.7 branch (closes #26452). Discussion ---------- [Intl] Load locale aliases to support alias fallbacks | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21457 | License | MIT | Doc PR | - For example, `zh_TW` is an alias to `zh_Hant_TW`. Without aliases,` zh_TW` would fall back to `zh` (which is incorrect). With aliases loaded, `zh_TW` will fall back properly to `zh_Hant_TW`. Judging by git history this has never worked. ```php \Locale::setDefault('zh'); dump(Intl::getRegionBundle()->getCountryName('AD')); \Locale::setDefault('zh_TW'); dump(Intl::getRegionBundle()->getCountryName('AD')); \Locale::setDefault('zh_Hant_TW'); dump(Intl::getRegionBundle()->getCountryName('AD')); ``` Before: ``` "安道尔" "安道尔" "安道爾" ``` After: ``` "安道尔" "安道爾" "安道爾" ``` All tests are passing, including those from the `intl-data` group. Commits ------- 1debf79 [Intl] Load locale aliases to support alias fallbacks
Fixed by #26452. |
Hi, in the Symfony\Component\Intl\Resources\data\regions directory, there is a missing zh_TW.json file for the list of countries in traditional Chinese caracters (for Taïwan).
I add mine in attach, if that may helps. zh_TW.zip
Thanks,
Lanphy
The text was updated successfully, but these errors were encountered: