DateFormatSymbols.getShortMonths() returns non-localized strings for certain locales

Description

Deleted Component: formatting

Using the following test code against ICU4J 3.4.1 only ar, fr, hu and iw locales
seemt to return (somewhat) proper localized strings for the short months for the
type of calendar (e.g. Dou-l-Hidjja instead of déc. for fr locale, though it
seems that Dou-l-Hidjja is not really abbreviated the way one would expect a
short month to be. Not sure what can be done there). Other locales like en are
returning Dec., which is clearly wrong for an Islamic calendar. The former
getMonths() APIs are deprecated, so this should work properly.

public void _testIslamicFormatter() throws Exception {

// Currently supported NLV locales
Locale ENGLISH = new Locale("en","US"); // We don't support 'en' alone
Locale ARABIC = new Locale("ar");
Locale CZECH = new Locale("cs");
Locale GERMAN = new Locale("de");
Locale GREEK = new Locale("el");
Locale SPANISH = new Locale("es");
Locale FRENCH = new Locale("fr");
Locale HUNGARIAN = new Locale("hu");
Locale ITALIAN = new Locale("it");
Locale HEBREW = new Locale("iw");
Locale JAPANESE = new Locale("ja");
Locale KOREAN = new Locale("ko");
Locale POLISH = new Locale("pl");
Locale PORTUGUESE = new Locale("pt","BR");
Locale RUSSIAN = new Locale("ru");
Locale TURKISH = new Locale("tr");
Locale CHINESE_SIMPLIFIED = new Locale("zh","CN");
Locale CHINESE_TRADITIONAL = new Locale("zh","TW");

Locale[] locales = new Locale[] {
ENGLISH,
ARABIC,
CZECH,
GERMAN,
GREEK,
SPANISH,
FRENCH,
HUNGARIAN,
ITALIAN,
HEBREW,
JAPANESE,
KOREAN,
POLISH,
PORTUGUESE,
RUSSIAN,
TURKISH,
CHINESE_SIMPLIFIED,
CHINESE_TRADITIONAL
};

String[] islamicTwelfthMonthLocalized = new String[locales.length];
String[] gregorianTwelfthMonthLocalized = new String[locales.length];

for (int i = 0; i < locales.length; i++) {

Locale locale = locales[i];

// Islamic
com.ibm.icu.util.Calendar islamicCalendar = new
com.ibm.icu.util.IslamicCalendar( locale );
com.ibm.icu.text.SimpleDateFormat islamicDateFormat =
(com.ibm.icu.text.SimpleDateFormat)islamicCalendar.getDateTimeFormat(
com.ibm.icu.text.DateFormat.FULL, -1, locale );
com.ibm.icu.text.DateFormatSymbols islamicDateFormatSymbols =
islamicDateFormat.getDateFormatSymbols();

String[] shortMonths = islamicDateFormatSymbols.getShortMonths();
String twelfthMonthLocalized = shortMonths[11];

islamicTwelfthMonthLocalized[i] = twelfthMonthLocalized;

// Gregorian
com.ibm.icu.util.Calendar gregorianCalendar = new
com.ibm.icu.util.GregorianCalendar( locale );
com.ibm.icu.text.SimpleDateFormat gregorianDateFormat =
(com.ibm.icu.text.SimpleDateFormat)gregorianCalendar.getDateTimeFormat(
com.ibm.icu.text.DateFormat.FULL, -1, locale );

com.ibm.icu.text.DateFormatSymbols gregorianDateFormatSymbols =
gregorianDateFormat.getDateFormatSymbols();
shortMonths = gregorianDateFormatSymbols.getShortMonths();
twelfthMonthLocalized = shortMonths[11];

gregorianTwelfthMonthLocalized[i] = twelfthMonthLocalized;

}

// Compare
for (int i = 0; i < locales.length; i++) {

String gregorianTwelfthMonth = gregorianTwelfthMonthLocalized[i];
String islamicTwelfthMonth = islamicTwelfthMonthLocalized[i];

System.out.println( locales[i] + ": " + gregorianTwelfthMonth + ", "
+ islamicTwelfthMonth );
//assertTrue( !gregorianTwelfthMonth.equalsIgnoreCase(
islamicTwelfthMonth ) );
}
}

Activity

Show:
TracBot
June 30, 2018, 11:26 PM
Trac Comment 4 by anonymous—2010-07-09T12:58:11.686Z

Iqclvu http://ruerodating.co.cc/ tgnioqq http://rusintimmeeting.co.cc/ wlvlwck http://rusintimdating.co.cc/ kinikbb.

TracBot
June 30, 2018, 11:26 PM
Trac Comment 5 by anonymous—2010-07-09T12:58:41.668Z

Nmpzrk http://ruprivatmeeting.co.cc/ jpexckh http://ruprivatfrands.co.cc/ mnqcgel http://ruprivatdating.co.cc/ fbqfgft.

TracBot
June 30, 2018, 11:26 PM
Trac Comment 6 by anonymous—2010-07-09T12:59:20.209Z

Nvdiak http://ruprivatfrands.co.cc/ jowqrqm http://ruprivatdating.co.cc/ cpktrii http://rueroznakomstvo.co.cc/ abqmhwz.

TracBot
June 30, 2018, 11:26 PM
Trac Comment 7 by anonymous—2010-07-09T12:59:41.755Z

Dkuzjy http://ruerofrands.co.cc/ erwnpzl http://ruerodating.co.cc/ dlqppky http://rusintimmeeting.co.cc/ xrvaiuk.

TracBot
June 30, 2018, 11:26 PM
Trac Comment 8 by —2016-10-05T23:17:31.574Z

Milestone 3.8 candidate deleted

Fixed

Assignee

Steven R. Loomis

Reporter

TracBot

Components

None

Labels

Reviewer

None

Priority

assess

Time Needed

None

Fix versions