This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Intl
Fabien Potencier fec95e01a2 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
-------

0a9be0df6e [Intl][Validator] Handle alias locales/timezones
2019-05-06 11:58:38 +02:00
..
Collator Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00
Data [Intl] Compile localized timezone offset name 2019-04-29 11:29:26 +02:00
DateFormatter Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00
Exception Mark ExceptionInterfaces throwable 2018-08-29 17:58:00 +02:00
Globals Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00
Locale [Intl] Add polyfill for Locale::canonicalize() 2018-02-12 17:25:54 +01:00
NumberFormatter [Intl] Simplify API 2019-04-15 13:51:51 +02:00
ResourceBundle [Intl] Simplify API 2019-04-15 13:51:51 +02:00
Resources [Intl] Compile localized timezone offset name 2019-04-29 11:29:26 +02:00
Tests bug #31354 [Intl][Validator] Handle alias locales/timezones (ro0NL) 2019-05-06 11:58:38 +02:00
Util removed usage of backticks in exception messages 2018-09-10 09:26:34 +02:00
.gitignore [Intl] Refactored Locale component into two new components Icu and Intl 2013-04-05 10:11:14 +02:00
CHANGELOG.md [Intl] Rename Regions to Countries 2019-05-01 22:02:47 +02:00
composer.json updated version to 4.3 2018-11-26 17:19:01 +01:00
CONTRIBUTING.md renamed composer.phar to composer to be consistent with the Symfony docs 2015-02-08 08:41:14 +01:00
Countries.php [Intl] Rename Regions to Countries 2019-05-01 22:02:47 +02:00
Currencies.php [Intl] Add phpdoc 2019-05-01 08:13:26 +02:00
Intl.php [Intl] Rename Regions to Countries 2019-05-01 22:02:47 +02:00
Languages.php [Intl] Add phpdoc 2019-05-01 08:13:26 +02:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
Locale.php Merge branch '3.4' into 4.2 2019-04-01 09:32:59 +02:00
Locales.php [Intl][Validator] Handle alias locales/timezones 2019-05-06 11:58:29 +02:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md [Intl] Fixed the broken link 2018-02-02 10:30:16 +01:00
ResourceBundle.php [Intl] Simplify API 2019-04-15 13:51:51 +02:00
Scripts.php [Intl] Add phpdoc 2019-05-01 08:13:26 +02:00
Timezones.php bug #31354 [Intl][Validator] Handle alias locales/timezones (ro0NL) 2019-05-06 11:58:38 +02:00

Intl Component

A PHP replacement layer for the C intl extension that also provides access to the localization data of the ICU library.

The replacement layer is limited to the locale "en". If you want to use other locales, you should install the intl PHP extension instead.

Resources