Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Intl] Add Timezones#28831
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
[Intl] Add Timezones#28831
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ro0NL commentedOct 12, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
note im not yet convinved about form type integration... if we go that way, we might want an option The intl variant IMHO should include, and be sorted by offset, from here we also see a different format |
This PR was merged into the 4.2-dev branch.Discussion----------[Form] Deprecate TimezoneType regions option| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | yes| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#28848| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->I know i've added this option myself in 4.1, but given my recent development for#28624 i realized it's an opinionated feaure, which can/should be solved on user-side (`choice_filter/choice_loader` and/or `group_by`).- blocks translations as we dont have them (see#28831)- blocks possibility of switching to Intl zones which doesnt really have this filter feature (see#28836)~While at it, i solved a few issues with `OptionsResolver` that is able to deprecate options as of 4.2 also.~ Fixed in#28878- when resolved trigger the deprecation- allow to opt-out from triggering the deprecation- dont trigger deprecation for default values (only given ones)Commits-------5cb532d [Form] Deprecate TimezoneType regions option
Uh oh!
There was an error while loading.Please reload this page.
chalasr left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍 Once PR rebased and remaining comment addressed
ro0NL commentedDec 13, 2018
ill rebase and compile the full list tomorrow. Meanwhile, can we decide on#28846 Not sure we want to add the boilerplate classes now, only to deprecate them later again. |
| } | ||
| if (null ===$city &&0 !==strrpos($zone,'Etc:') &&false !==$i =strrpos($zone,':')) { | ||
| $city =str_replace('_','',substr($zone,$i +1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
i need to check if this fallback is still needed. Ive added the root bundle fallback above later, and AFAIK it makes this one redundant.
status: needs work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
for future reference, this solves
- "Africa\/Abidjan": "Greenwich Mean Time (Abidjan)",- "Africa\/Accra": "Greenwich Mean Time (Accra)",- "Africa\/Addis_Ababa": "East Africa Time (Addis Ababa)",- "Africa\/Algiers": "Central European Standard Time (Algiers)",+ "Africa\/Abidjan": "Greenwich Mean Time",+ "Africa\/Accra": "Greenwich Mean Time",+ "Africa\/Addis_Ababa": "East Africa Time",+ "Africa\/Algiers": "Central European Standard Time",
i think it's more explicit to always include the example city (ec), and i believe for these cases when it's not provided by intl we can infer it from here.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedMar 13, 2019
@ro0NL up to rebase and address any remaining comment? |
ro0NL commentedMar 16, 2019
@nicolas-grekas i've refigured out how the compile process went, and added a binary for it as such. Works for me :) Please validate. Need to solve remaining comments still, but compiling is fast at least now :) |
Uh oh!
There was an error while loading.Please reload this page.
This PR was merged into the 3.4 branch.Discussion----------[Intl] Add compile binary| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no-ish| 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 -->Compile the Intl data by invoking a single command, and make it work out-of-the-box. (Split from#28831)```bash$ src/Symfony/Component/Intl/Resources/bin/compile```run in repository root because ofhttps://github.com/symfony/symfony/blob/b7e798ef745a09ca2e76fba4afad0a04fcbd9195/src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php#L1413.4 is ok, 4.2 is not because of#28833 but new locales are introduced inhttps://github.com/symfony/symfony/pull/28977/files#diff-f52da32e1ee6b93598814090d0749aa6R1So as long as 3.4 is supported, but branches above add filters etc. during generation we're risking this discrepancy. I suggest after merge in upper branches to re-run `compile` (potential for automating, but run if needed :))Commits-------426b92f [Intl] Add compile binary
webmozart commentedApr 6, 2019
Should be rebased and finished as soon as#28846 is merged IMO. |
src/Symfony/Component/Intl/Data/Provider/TimezoneDataProvider.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
This PR was squashed before being merged into the 4.3-dev branch (closes#28846).Discussion----------[Intl] Simplify API| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#18368| License | MIT| Doc PR |symfony/symfony-docs#11221Simplifies the Intl API. It greatly reduces the no. of boilerplate classes in this component. Very over complicated, much wow :)Solving (IMHO):```phpclass LanguageBundle extends LanguageDataProvider implements LanguageBundleInterface```Which seems very over complicated just to provide static data.```php// beforeIntl::getLanguageBundle()->getLanguageName() // string | null// afterLanguages::getName() // stringLanguages::exists() // bool```I left out Canonicalization on puropose, that's a new topic to me.- [x] Languages- [x] Locales- [x] Currencies- [x] Regions- [x] Scripts- [ ] Timezones (#28831)- [x] Update constraints- [x] Update form typesThoughts?Commits-------d6b67d4 [Intl] Simplify API
fabpot commentedApr 15, 2019
ro0NL commentedApr 16, 2019
Hm right, i felt awkward about a possible double As a plain list, without any context, i chose to avoid this duplication by using For the form, an alternative approach is to use optgroups per offset. Semantically (for JS & co) that might be more useful even. Havent come to play around with this though. |
ro0NL commentedApr 17, 2019
compiled the TZ offsets :) |
Hanmac commentedApr 17, 2019
hm shouldn't the offset be based on DST too? |
ro0NL commentedApr 17, 2019
hm yes :) but we need a local time for that. Something likehttps://3v4l.org/57U2J could be taken into account in status: needs work |
ro0NL commentedApr 17, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Hanmac i've removed the last commit, i dont think we need to compile offsets and instead simply use status: needs review (still ready :)) |
Hanmac commentedApr 17, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ro0NL Question about the Translation: i saw in the german translation something about normal time, but isn't that wrong for DST and should it say summer time instead? maybe instead of going directly from DateTimeZone "Europe/Berlin" to Translation, maybe instead use https://github.com/unicode-org/icu/blob/master/icu4c/source/data/zone also has different lables for that |
ro0NL commentedApr 17, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Hanmac i checked the google widget again :) today it includes (in english so perhttps://github.com/unicode-org/icu/blob/78a4abc5ed5db9ddadb57dca0f5222e7639c124c/icu4c/source/data/zone/en.txt#L292-L295 it seems to always pick I interpreted these codes as
Symfony now follows So using IMHO using the generic name solves the issue of names varied based on local time, thus a more simple implementation 👍 (the offset should be dynamic and is a display/rendering concern for now - unrelated here) status: needs work |
ro0NL commentedApr 17, 2019
Hanmac commentedApr 17, 2019
the Translations are in the Meta like de used for CET or MEZ i think it is okay for now if the name you show is DST independent. I think what the pro way would be:
do you need to parse the abbr? i currently don't know what the best way would be there |
ro0NL commentedApr 17, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Hanmac can you check once more :) the fallback for de.json currently is
Yes https://github.com/unicode-org/icu/blob/30d203459720bb64c850680a79b0f393a60934ca/icu4c/source/data/misc/metaZones.txt#L3553-L3557 gives us europe/berlin > Europe_Central https://github.com/unicode-org/icu/blob/30d203459720bb64c850680a79b0f393a60934ca/icu4c/source/data/zone/de.txt#L1512-L1514 gives us Europe_Central > lg (Mitteleuropäische Zeit)
agree :)
agree :)
again, not sure how the abbr. is related... |
ro0NL commentedApr 17, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
to clarify, Symfony |
ro0NL commentedApr 17, 2019
I think i understand, Still, for the name itself, it's just another fallback. We only provide the long generic name for now. |
fabpot commentedApr 21, 2019
Thank you@ro0NL. |
This PR was squashed before being merged into the 4.3-dev branch (closes#28831).Discussion----------[Intl] Add Timezones| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | replaces#26851,#17628,#17636| License | MIT| Doc PR |symfony/symfony-docs#11447This PR compiles a new `TimezoneBundle` from ICU data, based on the following resources:-https://github.com/unicode-org/icu/tree/master/icu4c/source/data/zone-https://github.com/unicode-org/icu/blob/master/icu4c/source/data/misc/timezoneTypes.txt-https://github.com/unicode-org/icu/blob/master/icu4c/source/data/misc/metaZones.txtThe goal is to provide a fixed set of timezones, with a localized human readable name.For inspiration and to double check some data i used the timezone widget from google, e.g. when using Google Calendar.I've only pushed some common compiled locales for review, the rest will follow once finished.cc@jakzalCommits-------4bea198 [Intl] Add Timezones
This PR was merged into the 4.3-dev branch.Discussion----------[Validator] Allow intl timezones| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | ref#28836| License | MIT| Doc PR |symfony/symfony-docs#11502This PR considers the ICU timezones (#28831) as valid, as well as the PHP ones.Both can be used in `DateTimeZone`, but expired timezones cannot be used with `IntlTimeZone`. The `intlCompatibility` option ensures compatibility between both.Practically this allows for both `UTC` and `Etc/UTC`, where the latter should be preferred. I.e. currently `Etc/UTC` is considered an invalid timezone ... which it's not.Commits-------7294b59 [Validator] Allow intl timezones


Uh oh!
There was an error while loading.Please reload this page.
This PR compiles a new
TimezoneBundlefrom ICU data, based on the following resources:The goal is to provide a fixed set of timezones, with a localized human readable name.
For inspiration and to double check some data i used the timezone widget from google, e.g. when using Google Calendar.
I've only pushed some common compiled locales for review, the rest will follow once finished.
cc@jakzal