<i18n dev> RFR: 8154520: java.time: appendLocalizedOffset() should return the localized "GMT" string

Thejasvi Voniadka thejasvi.v.voniadka at oracle.com
Fri Jun 28 12:59:56 UTC 2019


Hi,

Request you to please review this change.


JBS:    https://bugs.openjdk.java.net/browse/JDK-8154520


Description:    At present, the "DateTimeFormatterBuilder.appendLocalizedOffset()" method formulates the base string as "GMT", without accounting for locale-specific transformations. This change is to return the localized version of "GMT" instead. So for example, instead of returning "GMT +5.30", it may now return "XXXX +5.30" where "XXXX" is the localized string for "GMT" for the locale associated with the formatter. I have used DateTimeTextProvider.getLocalizedResource() method to return the "gmtZeroFormat" value from CLDR/LDML corresponding to the given locale. The code defaults to "GMT" in the absence of such a localized value.


Webrev:    http://cr.openjdk.java.net/~vagarwal/8154520/webrev.1/


Additional notes:    I preferred to update and reuse an existing test instead of creating a new one. It already has the niceties in place, and creating another method would mean some amount of code redundancy. However, if that's the recommended norm, then I can change it.



More information about the i18n-dev mailing list