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] Add FallbackTrait for data generation#31432

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

Merged
nicolas-grekas merged 1 commit intosymfony:3.4fromro0NL:intl-fallback
May 9, 2019
Merged

[Intl] Add FallbackTrait for data generation#31432

nicolas-grekas merged 1 commit intosymfony:3.4fromro0NL:intl-fallback
May 9, 2019

Conversation

@ro0NL
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PRsymfony/symfony-docs#...

This is the last architectural change for the Intl data compilation. Promised.

It fixes de-duplicating a locale from its fallback locale. The problem is it uses a while-loop, comparing the locale to each fallback locale.

Given

  • root (val=A)
    • ur (val=B)
      • ur_IN (val=A)

We have an edge case where a locale (ur_IN) override its fallback locale (ur), setting/restoring the value back to the root locale. This happens for the GMT format in the timezone bundle i know of ... in this case theur_IN locale needs to write its own value.

The current approach is a while-loop comparing each fallback locale (ur, root) to the current locale (ur_IN). Eventually comparingur_IN <> root, which causes a wrong diff, as suchur_IN falls back tour providing the wrong value (val=B, where val=A is expected).

The new approach uses recursion so we only compareur <> ur_IN, whereur_IN on itself is compared toroot.

4.2)ro0NL@e24d8e6
4.3)ro0NL@31591d0

@nicolas-grekas
Copy link
Member

Thank you@ro0NL.

@nicolas-grekasnicolas-grekas merged commit36ddfd5 intosymfony:3.4May 9, 2019
nicolas-grekas added a commit that referenced this pull requestMay 9, 2019
This PR was merged into the 3.4 branch.Discussion----------[Intl] Add FallbackTrait for data generation| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->This is the last architectural change for the Intl data compilation. Promised.It fixes de-duplicating a locale from its fallback locale. The problem is it uses a while-loop, comparing the locale to each fallback locale.Given- `root` (val=A)  - `ur` (val=B)    - `ur_IN` (val=A)We have an edge case where a locale (ur_IN) override its fallback locale (ur), setting/restoring the value back to the root locale. This happens for the GMT format in the timezone bundle i know of ... in this case the `ur_IN` locale needs to write its own value.The current approach is a while-loop comparing each fallback locale (ur, root) to the current locale (ur_IN). Eventually comparing `ur_IN <> root`, which causes a wrong diff, as such `ur_IN` falls back to `ur` providing the wrong value (val=B, where val=A is expected).The new approach uses recursion so we only compare `ur <> ur_IN`, where `ur_IN` on itself is compared to `root`.4.2)ro0NL@e24d8e64.3)ro0NL@31591d0Commits-------36ddfd5 [Intl] Add FallbackTrait for data generation
@ro0NLro0NL deleted the intl-fallback branchMay 9, 2019 08:48
nicolas-grekas added a commit that referenced this pull requestMay 9, 2019
This PR was merged into the 4.3 branch.Discussion---------- [Intl] Revise timezone name generation| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes (inlcluding intl-data group)| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->This is the final polishing needed for#31294 :)I've realized it's much easier to de-duplicate by processing fallback locales separate, and then only keep the diff compared to a specific locale. More or less the same approach `LocaleDataGenerator` already follows. I was trying to be clever and filter based on inheritance in a single process; bad idea.Includesro0NL@31591d0 (ref#31432)Commits-------bfdb4ed [Intl] Revise timezone name generation
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

3 participants

@ro0NL@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp