[threeten-dev] ZoneId.getText() and generic name
Xueming Shen
xueming.shen at oracle.com
Thu Dec 20 10:48:46 PST 2012
On 12/20/2012 01:29 AM, Masayoshi Okutsu wrote:
> On 12/20/2012 5:05 PM, Xueming Shen wrote:
>> The change to support the generic zone name in ZoneId.getText(...)
>>
>> http://cr.openjdk.java.net/~sherman/jdk8_threeten/zidtext
>>
>> Naoto, Masayoshi,
>>
>> Is it possible to have a
>>
>> TimeZoneNameUtility.retrieveDispalyNamesExt(id, locale);
>>
>> to have the generic names attached to the id/std/dst list?
>> preferred cached as well:-)
>
> Yes, it's possible, but I prefer not to cache resources in JSR 310. Naoto is cleaning up/improving caches.
Agree the cache need to be in Naoto's place:-) So far I have had three
places need to cache those Strings... and ZoneId.getText(...) should/can
then invoke the utility method directly to obtain the text for specific
style/locale without having to build a date/time formatter.
>
>> btw, the generic names in cldr are not translated? I tried
>> the Japanese locale, it appears they are all English, while
>> the std/dst are translated. Or did I do anything wrong?
>
> The generic names in JRE are not translated. There are some differences between the legacy JRE localized time zone names and CLDR ones. I "invented" generic names in English, but will need to request translation of generic time zone names.
>
> If you specify CLDR as the source of localized resources, you should get translated generic names. That is, specify -Djava.locale.providers=CLDR.
>
Yep, I'm having Japanese name now with CLDR.
Thanks!
-Sherman
More information about the threeten-dev
mailing list