Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RFC][Form] Change TimezoneType to Intl sources / translate timezone choice labels #28836

Closed
@ro0NL

Description

@ro0NL

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:

  1. keep using \DateTimeZone::listIdentifiers() and only translate using TimezoneBundle
  2. switch to TimezoneBundle as a new feature (including translating)
  3. add an option intl => false to optionally switch
  4. option 3 + deprecating not setting it to true (force intl in 5.0)
  5. 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 by group_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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormIntlRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions