Adding a new method that returns a locale's display name with a short alternative territory name. The ICU library provides the uldn_openForContext() function that helps you to specify different types of context you want to display the locale. This change only adds the display context for lengths UDISPCTX_LENGTH_FULL and UDISPCTX_LENGTH_SHORT. There are other display context options available from ICU that can be easily added to the DISPLAY_CONTEXT constant.
Currently, this is the best option we have to display alt-short names that are available in CLDR. There is an open ICU ticket (ICU-8462) from 2018 to add alternative display name variants for locale and territory, but unsure how long it will be until it's implemented and available.
Adding a new method that returns a locale's display name with a short alternative territory name. The ICU library provides the
uldn_openForContext()
function that helps you to specify different types of context you want to display the locale. This change only adds the display context for lengthsUDISPCTX_LENGTH_FULL
andUDISPCTX_LENGTH_SHORT
. There are other display context options available from ICU that can be easily added to theDISPLAY_CONTEXT
constant.Currently, this is the best option we have to display
alt-short
names that are available in CLDR. There is an open ICU ticket (ICU-8462) from 2018 to add alternative display name variants for locale and territory, but unsure how long it will be until it's implemented and available.Examples of alternative names:
CLDR Territory data example
ICU References