-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing TZ exemplar city generation #3204
Conversation
@nordzilla could you shed some light on the alias logic? |
I've rewritten the logic. It now uses the first TZDB ID in the This leads to some data diffs, i.e. |
provider/repodata/data/json/time_zone/exemplar_cities@1/ar-EG.json
Outdated
Show resolved
Hide resolved
@@ -209,7 +210,7 @@ | |||
"kgfru": "Bishkek", | |||
"khpnh": "Phnom Penh", | |||
"kicxi": "Kiritimati", | |||
"kipho": "Kanton", | |||
"kipho": "Enderbury", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kanton
becoming Enderbury
is wrong, but expected, as Pacific/Enderbury
is listed before Pacific/Kanton
. This problem is tracked in https://unicode-org.atlassian.net/browse/CLDR-14453. en
works around it by having removed the display name for Pacific/Enderbury
, so that Pacific/Kanton
is used.
.map(|aliases| (bcp47, aliases)) | ||
}) | ||
.filter_map(|(bcp47, aliases)| { | ||
aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: There are 2 definitions of the canonical IANA alias for each time zone; one is the CLDR alias, which is more historical and always stable, and the other is the IANA alias, which tends to be more modern but is subject to change. The order of the aliases in the bcp47 file does not seem to correspond to whether it is the CLDR alias or the IANA alias. I know there are open issues about this, as well as an ECMA-402 proposal in the works to settle on whose alias is the one the industry should use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should include the last commit, it might lead to problems in the future. We should fix the data instead. |
This reverts commit 81cd7f5.
It already doesn't work with CLDR43 as that doesn't allow us to distinguish between explicitly set and key-derived values. |
Until CLDR gets their act together, any of the following are reasonable behaviors:
I think the PR is currently implementing 1, right? |
This does:
The last case currently only happens for the three English names that get added here, but will happen a lot in CLDR 43 |
#3181
CLDR 43 removes trivial display names entries, so iterating through display names will no longer work. We instead iterate through the BCP47/Tzid map.
The way this code deals with aliases seems to be unintentional, as it takes the alphabetically last value. I've preserved this behaviour, but it's something we should figure out.