Please sign in to comment.
bug #31354 [Intl][Validator] Handle alias locales/timezones (ro0NL)
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
- Loading branch information...
Showing with 74 additions and 24 deletions.
- +10 −2 src/Symfony/Component/Intl/Locales.php
- +7 −0 src/Symfony/Component/Intl/Tests/LocalesTest.php
- +13 −1 src/Symfony/Component/Intl/Tests/TimezonesTest.php
- +10 −4 src/Symfony/Component/Intl/Timezones.php
- +6 −2 src/Symfony/Component/Validator/Constraints/LocaleValidator.php
- +26 −14 src/Symfony/Component/Validator/Constraints/TimezoneValidator.php
- +2 −1 src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php