-
JEP
-
Resolution: Delivered
-
P2
-
Naoto Sato
-
Feature
-
Open
-
SE
-
-
314
Summary
Enhance java.util.Locale and related APIs to implement additional Unicode extensions of BCP 47 language tags.
Goals
Support for BCP 47 language tags was was initially added in Java SE 7, with support for the Unicode locale extension limited to calendars and numbers. This JEP will implement more of the extensions specified in the latest LDML specification, in the relevant JDK classes.
Non-Goals
Unicode language-tag extensions other than those described below will be ignored.
Description
As of Java SE 9, the supported BCP 47 U language-tag extensions are ca and nu. This JEP will add support for the following additional extensions:
cu(currency type)fw(first day of week)rg(region override)tz(time zone)
In order to support these additional extensions, changes will be made to the following APIs:
java.text.DateFormat::get*Instancewill return instances based on the extensionsca,rgand/ortzjava.text.DateFormatSymbols::getInstancewill return instances based on the extensionrgjava.text.DecimalFormatSymbols::getInstancewill return instances based on the extensionrgjava.text.NumberFormat::get*Instancewill return instances based on the extensionsnuand/orrgjava.time.format.DateTimeFormatter::localizedBywill returnDateTimeFormatterinstances based on the extensionsca,rg, and/ortzjava.time.format.DateTimeFormatterBuilder::getLocalizedDateTimePatternwill return pattern string based on thergextension.java.time.format.DecimalStyle::ofwill returnDecimalStyleinstances based on the extensionsnu, and/orrgjava.time.temporal.WeekFields::ofwill returnWeekFieldsinstances based on the extensionsfwand/orrgjava.util.Calendar::{getFirstDayOfWeek,getMinimalDaysInWeek}will return values based on the extensionsfwand/orrgjava.util.Currency::getInstancewill returnCurrencyinstances based on the extensionscuand/orrgjava.util.Locale::getDisplayNamewill return a string that includes display names for these U extensionsjava.util.spi.LocaleNameProviderwill have new SPIs for the keys and types of these U extensions
Risks and Assumptions
The display names returned from Locale::getDisplayName depend on the localized data provided by each locale provider.
- relates to
-
JDK-8190918 Retrieve the region specific data regardless of language in locale
-
- Closed
-
-
JDK-8188819 Host locale adapter should honor currency overrides
-
- In Progress
-
-
JDK-8191349 Add java.time.format.DateTimeFormatter localizedBy(locale) method to reflect Unicode extensions
-
- Resolved
-
-
JDK-8176841 Additional Unicode Language-Tag Extensions
-
- Resolved
-
-
JDK-8189134 New system properties for the default Locale extensions
-
- Resolved
-