You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ugo Cei <ug...@apache.org> on 2005/09/19 20:47:26 UTC

Re: svn commit: r289973 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/CalendarGenerator.java

Il giorno 18/set/05, alle 23:00, hepabolu@apache.org ha scritto:

> +	protected String weekdays[] = { "",
> +			"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
> +			"Friday", "Saturday"
> +	};

Since the CalendarGenerator strives to be localizable as far as 
possible, wouldn't it be better to use Java I18N features for 
outputting localized weekday names instead of this?

	Ugo

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/


Re: svn commit: r289973 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/CalendarGenerator.java

Posted by hepabolu <he...@gmail.com>.
Ugo Cei wrote:
> Il giorno 18/set/05, alle 23:00, hepabolu@apache.org ha scritto:
> 
>> +    protected String weekdays[] = { "",
>> +            "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
>> +            "Friday", "Saturday"
>> +    };
> 
> 
> Since the CalendarGenerator strives to be localizable as far as 
> possible, wouldn't it be better to use Java I18N features for outputting 
> localized weekday names instead of this?
> 
>     Ugo
> 
True, I've thought about this, but I intended the weekday attribute to 
be used for comparisons like "is this a weekday or a weekend day". In 
that case you don't want to depend on the current locale. You cannot 
depend on the order in the list either, since the first day in the week 
list is the first day of the week for that particular locale.

I could of course put in the ordinal (i.e. Sunday = 1), but that means 
you always need extra info to figure out what is what, i.e. context that 
you don't have once the calendar is generated.

I18n localizations can still be done using the i18n transformer with 
these names as keys.

WDYT?

Bye, Helma