-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b12
-
generic
-
generic
-
Verified
Steps:
Tests Month value by type consistency between CLDR and Java, using "JANUARY" and "SHORT" as input.
For example: on language tag pa-PK. As CLDR's definition, locale pa_PK will be replaced to pa_Arab_PK in supplementalMetadata.xml file. There is no element of monthContext [@type=format]/monthWidth[@type=abbreviated]/month[@type=1] in pa_Arab_PK.xml file, but as CLDR fallback mechanism, should fall back to pa_Arab.xml file, but still there isn't abbreviated month in pa_Arab.xml, and then fallback to root.xml as CLDR defined, then should return "wide" type instead "abbreviated", so the result should be جنوری
The issue happens on locale pa-PK, sr-ME, uz-AF. The reason looks like Java doesn't handle languageAlias.
To compare the output format in Java, by running below code.
public void getMonthElement() {
String tag= "pa-PK";
Locale target = Locale.forLanguageTag(tag);
Month day = Month.valueOf("JANUARY");
TextStyle style = TextStyle.valueOf("SHORT");
String actualResult = day.getDisplayName(style, target);
System.out.println(actualResult);
}
Result:
The output of Java is "ਜਨ", instead of جنوری.
Tests Month value by type consistency between CLDR and Java, using "JANUARY" and "SHORT" as input.
For example: on language tag pa-PK. As CLDR's definition, locale pa_PK will be replaced to pa_Arab_PK in supplementalMetadata.xml file. There is no element of monthContext [@type=format]/monthWidth[@type=abbreviated]/month[@type=1] in pa_Arab_PK.xml file, but as CLDR fallback mechanism, should fall back to pa_Arab.xml file, but still there isn't abbreviated month in pa_Arab.xml, and then fallback to root.xml as CLDR defined, then should return "wide" type instead "abbreviated", so the result should be جنوری
The issue happens on locale pa-PK, sr-ME, uz-AF. The reason looks like Java doesn't handle languageAlias.
To compare the output format in Java, by running below code.
public void getMonthElement() {
String tag= "pa-PK";
Locale target = Locale.forLanguageTag(tag);
Month day = Month.valueOf("JANUARY");
TextStyle style = TextStyle.valueOf("SHORT");
String actualResult = day.getDisplayName(style, target);
System.out.println(actualResult);
}
Result:
The output of Java is "ਜਨ", instead of جنوری.
- relates to
-
JDK-8207033 ZonedDateTime could not parse timezone name with zh_CN locale correctly.
-
- Closed
-