-
Notifications
You must be signed in to change notification settings - Fork 182
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
Datagen: Change time zone untagged enum resolution to work with CLDR 44 #4158
Conversation
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.
Do we want to add a fn exemplar_city_alt_secondary(&self) -> Option<String>
in the impl Location {...}
block to match the new field in the Location
struct?
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.
Probably not unless we need it. It's dead code otherwise. I was considering just deleting the functions and accessing the fields directly.
@srl295 Do you have a suggestion on a better way to achieve this? We have an object which could be one or the other shape, and the CLDR JSON schema tells us nothing about which one is in that position. I don't know how else to determine whether this is a "SubRegion" or "Location" node other than checking for the presence of certain keys, which is brittle (it broke in CLDR 44). |
To clarify: the JSON looks like "zone": {
"America": {
"Asuncion": {
"exemplarCity": "Asunción"
},
"Bahia_Banderas": {
"exemplarCity": "Bahia Banderas"
},
...
"Havana": {
"exemplarCity": "Havanna"
},
"Indiana": {
"Vincennes": {
"exemplarCity": "Vincennes, Indiana"
},
"Petersburg": {
"exemplarCity": "Petersburg, Indiana"
},
...
"Vevay": {
"exemplarCity": "Vevay, Indiana"
}
},
"Jamaica": {
"exemplarCity": "Jamaika"
}, Here, |
It's like duck typing but some of the ducks flew off. OK… what about adding a |
What's the urgency here? If this is fragile-but-works, could we propose One observation, is that using {
"zones": {
"America/Ascuncion": { }
"America/Indiana/Vincennes": { }
}
} … then you wouldn't have the issue. |
please file a CLDR issue in any event. |
Something along these lines would be helpful. Good to know we can move in this direction. I don't consider this a CLDR 44 blocker though, because we had to do the duck typing in CLDR 43 as well, just the rules changed. I'll open an issue to investigate this for CLDR 45. |
A flat structure would be easier to parse. Our parser basically needs to transform the table into a form more like this one, with the "/" glue, before it can do anything else. |
maybe Wait a second, though, this is trying to make the localization file self-describing. The
|
Part of #4155
CLDR 44 now includes data such as the following:
We need to detect that this is a name table and not a sub-region table. Previously we used the presence of either
exemplarCity
,short
, orlong
to make this determination. I am changing the code to also check forexemplarCity-alt-secondary
. I'm also reversing the polarity of the check to make the code cleaner.