babel icon indicating copy to clipboard operation
babel copied to clipboard

Bad short british timezone name for Honolulu

Open not-a-user opened this issue 1 year ago • 2 comments

babel.dates.get_timezone_name('Pacific/Honolulu', 'short', locale='en_GB') returns '∅∅∅' which looks bad to me:

(venv) [babel]$ git log --format=oneline -1
05960657895d7dbb2e1ab47cb8e004f9c6953457 (HEAD -> master, origin/master, origin/HEAD) Move pytest config to pyproject.toml (#1187)

(venv) [babel]$ python -m pip install .
[...]
Successfully installed babel-2.17.0

(venv) [babel]$ python
Python 3.13.1 (main, Dec  9 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import babel.dates
>>> babel.dates.get_timezone_name('Pacific/Honolulu', 'short', locale='en_GB')
'∅∅∅'
>>> babel.dates.get_timezone_name('Pacific/Honolulu', 'short', locale='en_US')
'HST'

not-a-user avatar Feb 25 '25 20:02 not-a-user

∅∅∅ is the no-inheritance marker, and it definitely shouldn't appear as an output.

However, the CLDR spec only talks about that marker for metazones, not concrete zones such as Pacific/Honolulu, so I'll probably have to check how icu4c and icu4j deal with this.

en_001 (Global English) has https://github.com/unicode-org/cldr/blob/8d092a26ba416eb5bb001dbb419effa188f73904/common/main/en_001.xml#L818-L824 – originally from https://github.com/unicode-org/cldr/commit/247c6dee563ef94cc6e11b8f3b06960aac930792 (and probably earlier).

akx avatar Mar 03 '25 15:03 akx

Interesting.

env TEST_TIMEZONES=Pacific/Honolulu TEST_LOCALES=en_US,en,en_GB ./icu4c_get_tz_name
Pacific/Honolulu:en_US:HST:HST:HST:Hawaii-Aleutian Standard Time
Pacific/Honolulu:en:HST:HST:HST:Hawaii-Aleutian Standard Time
Pacific/Honolulu:en_GB:GMT-10:GMT-10:GMT-10:Hawaii-Aleutian Standard Time

ICU4C formats it as GMT-10 in en_GB... wonder where that fallback comes from.

akx avatar Mar 04 '25 08:03 akx