diff --git a/make/tools/src/build/tools/cldrconverter/CLDRConverter.java b/make/tools/src/build/tools/cldrconverter/CLDRConverter.java index 9cbf02a9c3b112fd69c35a107f902ad213e2752e..33ea34ffa2aea40e72de9dfc8a76dbce8c909a81 100644 --- a/make/tools/src/build/tools/cldrconverter/CLDRConverter.java +++ b/make/tools/src/build/tools/cldrconverter/CLDRConverter.java @@ -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)) { diff --git a/make/tools/src/build/tools/cldrconverter/CalendarType.java b/make/tools/src/build/tools/cldrconverter/CalendarType.java index b530080ae71cb6c85d8be956e11d9e5501a50989..561907e63819fb053247b90649085f84d0ecc499 100644 --- a/make/tools/src/build/tools/cldrconverter/CalendarType.java +++ b/make/tools/src/build/tools/cldrconverter/CalendarType.java @@ -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; diff --git a/src/share/classes/sun/text/resources/FormatData.java b/src/share/classes/sun/text/resources/FormatData.java index 960249a8752d43c2d62956e32b0dcce747711a86..971177fd61a93e15350299f64f0a8f28e469119f 100644 --- a/src/share/classes/sun/text/resources/FormatData.java +++ b/src/share/classes/sun/text/resources/FormatData.java @@ -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" }, }; } } diff --git a/src/share/classes/sun/text/resources/ar/FormatData_ar.java b/src/share/classes/sun/text/resources/ar/FormatData_ar.java index 3be4cd39e6f96420d995addcc52a74edb5cea18a..acb5cb9c409ed051cc8dc4f58671f540ccb32f0e 100644 --- a/src/share/classes/sun/text/resources/ar/FormatData_ar.java +++ b/src/share/classes/sun/text/resources/ar/FormatData_ar.java @@ -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" }, }; } } diff --git a/test/java/time/test/java/time/format/TestNonIsoFormatter.java b/test/java/time/test/java/time/format/TestNonIsoFormatter.java index af6be84ef923dcf8b14631a28f911897d8223edc..7246a82af207b53d4add353fc665f52e19e774fa 100644 --- a/test/java/time/test/java/time/format/TestNonIsoFormatter.java +++ b/test/java/time/test/java/time/format/TestNonIsoFormatter.java @@ -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 }; }