Closed
Description
Description
Currently the TimezoneType does not depend on symfony/intl (unlike LanguageType etc.), but uses vanilla PHP based on \DateTimeZone::listIdentifiers()
.
There are several issues (#26851, #17628, #17636) that request to use localized zone labels.
For that i've finished #28831 to provide the actual translations, based on ICU, just like languages, etc.
However it doesnt mean we should switch from \DateTimeZone::listIdentifiers()
to TimezoneBundle::getZoneNames()
per se, hence the RFC.
I see several options:
- keep using
\DateTimeZone::listIdentifiers()
and only translate usingTimezoneBundle
- switch to
TimezoneBundle
as a new feature (including translating) - add an option
intl => false
to optionally switch - option 3 + deprecating not setting it to true (force intl in 5.0)
- option 2 + deprecating submitting unsupported zones (few)
Personally i'd prefer symfony/intl so there's no environment dependency, and we have better control to blacklist/mutate etc.
Related
- consider adding
input=intltimezone
to leverage\IntlTimeZone
as underlying model - the current
regions
option relies on\DateTimeZone::listIdentifiers()
, so if in any scenario Intl will be used the option is incompatible, meaning we either implement a fallback or deprecate it all together (favored bygroup_by
to let the user decide in all cases) - re-consider timezone sorting (going from -xx:00 to +xx:00 makes sense and is intuitive, given the GMT+- offset is included in the label - see e.g. [Intl] Add Timezones #28831 (comment))
Thougts?