fec95e01a2
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
-------
|
||
---|---|---|
.. | ||
Collator | ||
Data | ||
DateFormatter | ||
Exception | ||
Globals | ||
Locale | ||
NumberFormatter | ||
ResourceBundle | ||
Resources | ||
Tests | ||
Util | ||
.gitignore | ||
CHANGELOG.md | ||
composer.json | ||
CONTRIBUTING.md | ||
Countries.php | ||
Currencies.php | ||
Intl.php | ||
Languages.php | ||
LICENSE | ||
Locale.php | ||
Locales.php | ||
phpunit.xml.dist | ||
README.md | ||
ResourceBundle.php | ||
Scripts.php | ||
Timezones.php |
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
- Documentation
- Contributing
- Report issues and send Pull Requests in the main Symfony repository
- Docker images with intl support (for the Intl component development)