Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Intl] Load locale aliases to support alias fallbacks#26452

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@jakzal
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#21457
LicenseMIT
Doc PR-

For example,zh_TW is an alias tozh_Hant_TW. Without aliases, zh_TW would fall back tozh (which is incorrect). With aliases loaded,zh_TW will fall back properly tozh_Hant_TW.

Judging by git history this has never worked.

\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 theintl-data group.

teohhanhui reacted with thumbs up emoji
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.
Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Although I don't understand the internals of this, the change looks correct, all test pass and the new test make sense to me. Thanks Jakub!

@jakzal
Copy link
ContributorAuthor

@javiereguiluz all our icu data providers use an entry reader to actually read icu data from (currently) json files we bundle with the intl component. The entry reader already supports handling aliases. However, we never told it to use any aliases. Now we do :)

javiereguiluz reacted with thumbs up emoji

jakzal added a commit that referenced this pull requestMar 9, 2018
…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
@jakzaljakzal closed thisMar 9, 2018
@jakzaljakzal deleted the bugfix/intl-locale-alias-resolution branchMarch 9, 2018 11:32
This was referencedApr 2, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@jakzal@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp