提交 a327a645 编写于 作者: O okutsu

8015986: Incorrect Localization of HijrahChronology

Reviewed-by: naoto
Contributed-by: scolebourne@joda.org, roger.riggs@oracle.com
上级 06434b40
......@@ -605,7 +605,23 @@ public class CLDRConverter {
copyIfPresent(map, key, formatData);
}
}
// Workaround for islamic-umalqura name support (JDK-8015986)
switch (id) {
case "ar":
map.put(CLDRConverter.CALENDAR_NAME_PREFIX
+ CalendarType.ISLAMIC_UMALQURA.lname(),
// derived from CLDR 24 draft
"\u0627\u0644\u062a\u0642\u0648\u064a\u0645 "
+"\u0627\u0644\u0625\u0633\u0644\u0627\u0645\u064a "
+"[\u0623\u0645 \u0627\u0644\u0642\u0631\u0649]");
break;
case "en":
map.put(CLDRConverter.CALENDAR_NAME_PREFIX
+ CalendarType.ISLAMIC_UMALQURA.lname(),
// derived from CLDR 24 draft
"Islamic Calendar [Umm al-Qura]");
break;
}
// Copy available calendar names
for (String key : map.keySet()) {
if (key.startsWith(CLDRConverter.CALENDAR_NAME_PREFIX)) {
......
......@@ -31,7 +31,8 @@ import java.util.Locale;
* Constants for the Calendars supported by JRE.
*/
enum CalendarType {
GREGORIAN("gregory"), BUDDHIST, JAPANESE, ROC, ISLAMIC, ISLAMIC_CIVIL("islamicc");
GREGORIAN("gregory"), BUDDHIST, JAPANESE, ROC,
ISLAMIC, ISLAMIC_CIVIL("islamicc"), ISLAMIC_UMALQURA("islamic-umalqura");
private static final int[][] ERA_DATA = {
// start index, array length
......@@ -41,6 +42,7 @@ enum CalendarType {
{0, 2}, // roc (Minguo)
{0, 1}, // islamic (Hijrah)
{0, 1}, // islamicc (same as islamic)
{0, 1}, // islamic-umalqura
};
private final String lname; // lowercase name
......@@ -52,8 +54,8 @@ enum CalendarType {
private CalendarType(String uname) {
String lname = name().toLowerCase(Locale.ROOT);
if (lname.equals("islamic_civil")) {
lname = "islamic-civil";
if (lname.startsWith("islamic_")) {
lname = lname.replace('_', '-');
}
this.lname = lname;
this.uname = (uname != null) ? uname : lname;
......
......@@ -858,6 +858,9 @@ public class FormatData extends ParallelListResourceBundle {
}
},
{ "DateTimePatternChars", "GyMdkHmsSEDFwWahKzZ" },
// Workaround for islamic-umalqura name support (JDK-8015986)
{ "calendarname.islamic-umalqura", "Islamic Umm al-Qura Calendar" },
};
}
}
......@@ -264,6 +264,10 @@ public class FormatData_ar extends ParallelListResourceBundle {
}
},
{ "DateTimePatternChars", "GanjkHmsSEDFwWxhKzZ" },
// Workaround for islamic-umalqura name support (JDK-8015986)
{ "calendarname.islamic-umalqura",
"\u0644\u062a\u0642\u0648\u064a\u0645 \u0627\u0644\u0647\u062c\u0631\u064a\u060c \u0623\u0645 \u0627\u0644\u0642\u0631\u0649" },
};
}
}
......@@ -110,7 +110,7 @@ public class TestNonIsoFormatter {
// Chronology, Locale, Chronology Name
{ ISO8601, Locale.ENGLISH, "ISO" }, // No data in CLDR; Use Id.
{ BUDDHIST, Locale.ENGLISH, "Buddhist Calendar" },
{ HIJRAH, Locale.ENGLISH, "Hijrah-umalqura" }, // No data in CLDR; Use Id.
{ HIJRAH, Locale.ENGLISH, "Islamic Umm al-Qura Calendar" }, // JDK-8015986
{ JAPANESE, Locale.ENGLISH, "Japanese Calendar" },
{ MINGUO, Locale.ENGLISH, "Minguo Calendar" },
......@@ -121,6 +121,10 @@ public class TestNonIsoFormatter {
{ ISO8601, thTH, "ISO" }, // No data in CLDR; Use Id.
{ JAPANESE, thTH, "\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e0d\u0e35\u0e48\u0e1b\u0e38\u0e48\u0e19" },
{ BUDDHIST, thTH, "\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e1e\u0e38\u0e17\u0e18" },
{ HIJRAH, ARABIC, "\u0644\u062a\u0642\u0648\u064a\u0645 "
+ "\u0627\u0644\u0647\u062c\u0631\u064a\u060c "
+ "\u0623\u0645 \u0627\u0644\u0642\u0631\u0649" }, // JDK-8015986
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册