How localization in "org.apache.turbine.util.DateSelector" is done?
Here so:

Calendar calendar = Calendar.getInstance(Localization.getLocale(request));
DateSelector.getMonthSelector(nameSelector,calendar)


- does not work - always returns name Month in system locale (ru). 8(
---------------------------

It was necessary to be inherited from ххх:

public class DateSelector extends org.apache.turbine.util.DateSelector {

/**
* Get HTML-Selector with names month on requested locale
* @param name - selector
* @param now - * @param locale - request locale
* @return
*/
public static Select getMonthSelector(String name, Calendar now, Locale locale) {
String monthName[] = (new DateFormatSymbols(locale)).getMonths();
Select monthSelect = (new Select()).setName(name);
for(int curMonth = 0; curMonth <= 11; curMonth++) {
Option o = new Option();
o.addElement(monthName[curMonth]);
o.setValue(curMonth);
if(now.get(2) == curMonth)
o.setSelected(true);
monthSelect.addElement(o);
}
return monthSelect;
}



} ===================================== but can eat better a way?


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to