<i18n dev> Return value of DateFormatSymbols.getWeekdays()
naoto.sato at oracle.com
naoto.sato at oracle.com
Tue Nov 5 16:34:05 UTC 2019
Hi Zhuoren,
Thanks for looking into it. Recent JDK's locale data, including 11u/13
are extracted from Unicode Consortium's CLDR project, and the file you
modified was exactly from their repository. [1]
Since ROOT locale is the invariant language neutral locale, I think
CLDR's intention was to obscure the language-ness in its names. Arguably
"Sun", "Mon"... are English based, but less English than "Sunday",
"Monday"... If you look at the month names, they are "M01", "M02" which
are totally language neutral.
So I think it is correct as it is, and I don't think we would need to
modify CLDR's locale data for JDK use. If you still think "Sunday" etc.
should be used, I'd suggest you file a request at CLDR.
Naoto
[1] https://github.com/unicode-org/cldr/blob/latest/common/main/root.xml
On 11/4/19 10:31 PM, Wang Zhuo(Zhuoren) wrote:
> Hi,
> I am an engineer from Alibaba, and I have a question for return value of DateFormatSymbols.getWeekdays().
> When using DateFormatSymbols.getInstance(Locale.ROOT).getWeekdays(), on JDK13 or JDK11u we get short names, such as Sun, Mon. While I think the return value should be full names, such as Sunday, Monday. The comments of this method also indicate full names.
> DateFormatSymbols.java:
> /**
> * Weekday strings. For example: "Sunday", "Monday", etc. An array
> * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
> * <code>Calendar.MONDAY</code>, etc.
> * The element <code>weekdays[0]</code> is ignored.
> * @serial
> */
> String weekdays[] = null;
>
> This issue only exists in Local.ROOT, DateFormatSymbols.getInstance(Locale.US).getWeekdays() returns full names.
> I think it makes sense to return full names not short ones for Local.ROOT. What's your opinion?
>
> It seems this issue is caused by abbreviated and wide dayWidth are set the same value in root.xml. I made a patch for this, please also review it http://cr.openjdk.java.net/~wzhuo/getWeekdays//webrev.00/
>
> Regards,
> Zhuoren
>
>
>
>
>
More information about the i18n-dev
mailing list