* @param widgetProperties
* the current widget properties
*/
protected void localize(Map<String, Object> widgetProperties)
{
DateFormatSymbols dfSymbols = null;
if (GETINSTANCEMETHOD != null)
{
// try to use JDK 6 DateFormatSymbols.getInstance(Locale)
try
{
dfSymbols = (DateFormatSymbols)GETINSTANCEMETHOD.invoke(null,
new Object[] { getLocale() });
}
catch (Exception e)
{
// ignore
}
}
if (dfSymbols == null)
{
dfSymbols = new DateFormatSymbols(getLocale());
}
setWidgetProperty(widgetProperties, "MONTHS_SHORT", filterEmpty(dfSymbols.getShortMonths()));
setWidgetProperty(widgetProperties, "MONTHS_LONG", filterEmpty(dfSymbols.getMonths()));
setWidgetProperty(widgetProperties, "WEEKDAYS_MEDIUM", filterEmpty(dfSymbols
.getShortWeekdays()));
setWidgetProperty(widgetProperties, "WEEKDAYS_LONG", filterEmpty(dfSymbols.getWeekdays()));
widgetProperties.put("START_WEEKDAY", new Integer(Calendar.getInstance(getLocale())
.getFirstDayOfWeek() - 1));
if (Locale.SIMPLIFIED_CHINESE.equals(getLocale()) ||
Locale.TRADITIONAL_CHINESE.equals(getLocale()))
{
setWidgetProperty(widgetProperties, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols
.getShortWeekdays(), 2, 1)));
widgetProperties.put("WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols
.getShortWeekdays(), 2, 1)));
}
else
{
setWidgetProperty(widgetProperties, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols
.getShortWeekdays(), 0, 1)));
setWidgetProperty(widgetProperties, "WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols
.getShortWeekdays(), 0, 2)));
}
}