Skip to content
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

[Intl] Update timezones to ICU 64.2 + compile zone to country mapping #31262

Merged
merged 1 commit into from Apr 29, 2019

Conversation

Projects
None yet
6 participants
@ro0NL
Copy link
Contributor

commented Apr 26, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

This PR compiles the zone to country mapping (and vice versa) from ICU data:
https://github.com/unicode-org/icu/blob/master/icu4c/source/data/misc/windowsZones.txt

I've recompiled timezones on master due #31162, i should do it once more when it's merged upstream.

Having this data allows compatibility between PHP timezones and ICU;

For the timezone validator in Symfony, this would be required to have a compatible "regions" option, once it supports ICU as well (#28836 (comment))

@ro0NL ro0NL force-pushed the ro0NL:timezone-country branch 2 times, most recently from f81ab54 to 00f6355 Apr 26, 2019

@jakzal

This comment has been minimized.

Copy link
Member

commented Apr 26, 2019

Nice, I was waiting for the 3.4 merge to master.

Make sure intl-data tests are passing please :) They're not being run on the CI.

@nicolas-grekas nicolas-grekas added this to the next milestone Apr 27, 2019

@ro0NL ro0NL force-pushed the ro0NL:timezone-country branch from 00f6355 to 73337b7 Apr 28, 2019

@ro0NL ro0NL force-pushed the ro0NL:timezone-country branch from 73337b7 to 4af3ceb Apr 28, 2019

@ro0NL ro0NL changed the title [Intl] Compile zone to country mapping [Intl] Update timezones to ICU 64.2 + compile zone to country mapping Apr 28, 2019

@ro0NL ro0NL marked this pull request as ready for review Apr 28, 2019

@ro0NL

This comment has been minimized.

Copy link
Contributor Author

commented Apr 28, 2019

this ones ready, see last commit for the added timezones which are missing currently (cc @fabpot)

cc @sstok tests are passing 👍

The main change is we use Country Time (Location) instead of Location Time as a fallback.

Also a fallback was missing for e.g. zh_Hant_HK > zh_Hant > zh > root instead of zh_Hant_HK > root. Given we build a timezone name from individual parts, we need the fallback chain as such during generation.

I think this nails it, and im done with timezones for a while now 😆

@ro0NL ro0NL force-pushed the ro0NL:timezone-country branch from 74f127b to c5718f2 Apr 28, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Apr 29, 2019

@ro0NL Is it desired that we have a trailing white space in src/Symfony/Component/Intl/Resources/data/timezones/*.json files?

@ro0NL

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

@fabpot not sure :) all json files (en.json, composer.json) have trailing EOL; there are no parsing issues AFAIK. Unless you meant a different whitespace?

If it's about e.g. https://github.com/symfony/symfony/pull/31262/files#diff-5996b6b88384d2b755c17f069229882fR4 that's part of the localized interpunction; it's UTF :)

@ro0NL ro0NL force-pushed the ro0NL:timezone-country branch from 8b0f311 to 0d65644 Apr 29, 2019

@fabpot

fabpot approved these changes Apr 29, 2019

@fabpot fabpot force-pushed the ro0NL:timezone-country branch from 0d65644 to 3018a7a Apr 29, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Apr 29, 2019

Thank you @ro0NL.

@fabpot fabpot merged commit 3018a7a into symfony:master Apr 29, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Apr 29, 2019

feature #31262 [Intl] Update timezones to ICU 64.2 + compile zone to …
…country mapping (ro0NL)

This PR was squashed before being merged into the 4.3-dev branch (closes #31262).

Discussion
----------

[Intl] Update timezones to ICU 64.2 + compile zone to country mapping

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://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 PR compiles the zone to country mapping (and vice versa) from ICU data:
https://github.com/unicode-org/icu/blob/master/icu4c/source/data/misc/windowsZones.txt

I've recompiled timezones on master due #31162, i should do it once more when it's merged upstream.

Having this data allows compatibility between PHP timezones and ICU;
- https://www.php.net/manual/en/intltimezone.getregion.php
- https://www.php.net/manual/en/class.datetimezone.php#datetimezone.constants.per-country

For the timezone validator in Symfony, this would be required to have a compatible "regions" option, once it supports ICU as well (#28836 (comment))

Commits
-------

3018a7a [Intl] Update timezones to ICU 64.2 + compile zone to country mapping

@ro0NL ro0NL deleted the ro0NL:timezone-country branch Apr 29, 2019

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.