Skip to content

[Intl][Validator] Handle alias locales/timezones #31354

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

Merged
merged 1 commit into from
May 6, 2019
Merged

[Intl][Validator] Handle alias locales/timezones #31354

merged 1 commit into from
May 6, 2019

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented May 1, 2019

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

both timezones and locales have aliases (either thru deprecation/migration/etc.)

for locales we compile a mapping, for timezones we dont. yet we can benefit partial alias support thru DateTimeZone, which knows about most timezone IDs already.

both the timezone + locale validator already support aliases. Connsequently, we should support aliases in Timezones::exists() + Locales::exists() as well IMHO.

so far so good; the catch is; with this PR Locales::getName() supports aliases, whereas Timezones::getName() doesnt. I think it's reasonable for now, until we compile the timezone mapping so we can widen the timezone ID conversion here.

@nicolas-grekas nicolas-grekas added this to the 4.3 milestone May 5, 2019
@fabpot
Copy link
Member

fabpot commented May 6, 2019

Thank you @ro0NL.

@fabpot fabpot merged commit 0a9be0d into symfony:master May 6, 2019
fabpot added a commit that referenced this pull request May 6, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes #31354).

Discussion
----------

[Intl][Validator] Handle alias locales/timezones

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes (including intl-data group)
| Fixed tickets | #31022
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

both timezones and locales have aliases (either thru deprecation/migration/etc.)

for locales we compile a mapping, for timezones we dont. yet we can benefit partial alias support thru DateTimeZone, which knows about most timezone IDs already.

both the timezone + locale validator already support aliases. Connsequently, we should support aliases in  `Timezones::exists()`  + `Locales::exists()` as well IMHO.

so far so good; the catch is; with this PR `Locales::getName()` supports aliases, whereas `Timezones::getName()` doesnt. I think it's reasonable for now, until we compile the timezone mapping so we can widen the timezone ID conversion here.

Commits
-------

0a9be0d [Intl][Validator] Handle alias locales/timezones
@ro0NL ro0NL deleted the intl-validator branch May 6, 2019 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants