-
Notifications
You must be signed in to change notification settings - Fork 414
CLDR-17223 Use new menu attribute in territory display names #5225
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
base: main
Are you sure you want to change the base?
Conversation
conradarcturus
left a comment
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.
My preference would be to just drop the extensions: English (Myanmar) not English (Myanmar [Burma]) or English (Myanmar (Burma)). So I definitely favor the addition of menu core/extension values for Myanmar and Cocos Islands. Nonetheless, I'm happy to accept your solution since you are closer to the problem space.
I commented on an error you'll need to fix to run the CLDR modify script.
Btw I'm a bit confused, because in the test data it shows en-MM; English (Myanmar [Burma]) already -- before this change. I suspect there may be something hard-coded that is already doing the nested brackets.
Make sure to update the display name documentation:
https://github.com/unicode-org/cldr/blob/main/docs/ldml/tr35-general.md?plain=1#L135-L163
| <territory type="CC" menu="core">Cocos Islands</territory> | ||
| <territory type="CC" menu="extension">Keeling</territory> |
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 think this is good solution. Wikipedia seems to generally follow this pattern too.
| <!--@METADATA--> | ||
| <!--@DEPRECATED--> | ||
|
|
||
| <!ELEMENT localeDisplayPattern ( alias | ( localePattern*, localeSeparator*, localeKeyTypePattern*, special* ) ) > |
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.
Make sure to add the valid child here.
| <!ELEMENT localeDisplayPattern ( alias | ( localePattern*, localeNestedPattern*, localeSeparator*, localeKeyTypePattern*, special* ) ) > |
So, in the specific case of Myanmar (Burma), maybe it's time to just drop the parenthetical. But, there are hundreds of other cases. I'm seeking to find the correct general solution here. Here are more examples: Alternative names for the same territory:
Clarification about who owns a particular territory:
So unless we want to use a pattern that avoids the parentheses entirely (which I'm open to exploring), we need to answer what happens with the nested parentheses.
Fixed, thanks!
There's hacky code somewhere that does a string substitution for '(' to '['. UTS 35 says:
https://unicode.org/reports/tr35/tr35-general.html#locale_display_name_algorithm I claim that this is terrible for both quality and implementability, and I want to improve it.
Yep, I'll work on that once we have alignment on the approach. |
|
If we consider the contents of the parenthetical to be "optional", another approach could be to include the parenthetical when formatting a region display name, but drop it when formatting a locale display name. new Intl.DisplayNames("en", { type: "region" }).of("MM")
// => "Myanmar (Burma)"
new Intl.DisplayNames("en", { type: "language" }).of("en-MM")
// => "English (Myanmar)"
// NOT "English (Myanmar [Burma])" ? |

CLDR-17223
I'm doing just English to start. I already found an odd case: we have "Cocos (Keeling) Islands" which isn't easily constructible from a menu glue pattern.
Please give feedback and suggestions. I would like to land this change relatively quickly because it blocks ICU4X.