Automattic / Automattic/wp-cldr
Build a better time zone selector (and engineer out continents-cities.php)
- Dominant language
- PHP
- Stars
- 24
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
WordPress core currently includes a hack around time zones, a [php file called continents-cities.php](https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/continents-cities.php). This isn't used by any code but includes a list of ~500 geographic names in English wrapped in `__()` so they get into GlotPress. Language packs include localized versions of this file. [Core's time zone selector](https://core.trac.wordpress.org/browser/trunk/wp-includes/functions.php?rev=23738#L3337) then gets a list of time zone IDs from PHP's `timezone_identifiers_list()`, does some parsing, generates a drop down list, and uses those localized strings for display names.
A couple issues here:
- continents-cities.php creates ~500 strings of unnecessary busy work for our translators. These country/region names have all been translated widely before and we don't get to take advantage of all that work (and as a result have inconsistencies and gaps across our locales).
- [The IANA's list of cities](http://www.iana.org/time-zones) isn't a great centerpiece for a UI. Those choices were driven by geography and time zone boundaries, an approach which makes sense in a standards-body kind of way but isn't how most users think (11 examples for Antarctica? Eight for the U.S. state of Indiana?). Also, that list can be brittle due to variations in PHP versions of the time zone db.
- The design approach -- a drop-down menu of 500 items (😱) -- could use some love.
CLDR data could offer a better way.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading continents-cities.php and the time zone selector in wp-includes/functions.php, then review the linked IANA time-zone context and the repository's CLDR data. The issue is complete when WordPress has a clearly specified, improved CLDR-based time-zone selector and no longer needs the unused continents-cities.php translation workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- frontend, internationalization, localization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100