cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: i18n transformer update
Date Thu, 24 Jan 2002 11:48:31 GMT
Piroumian, Konstantin wrote:

>Hi, C2ers!
>
>As I have a little free time, I'm going to make some code clean up in i18n
>transformer and LocaleAction. I've already added JavaDoc comments to all
>public members and polished a little class comments.
>
Cool ! We're using i18n on our projects and I started digging in the 
code last Monday. I wanted to propose some changes (see below).

>Next I am going to create an I18nUtils class that will contain all general
>purpose i18n routines, such as locale string parsing, date/number formatting
>and parsing, etc. Currently, it will be placed in org.apache.cocoon.i18n
>package.
>
+1.

>Also, I'm going to add a new <i18n:get-locale> element that will use
>LocaleAction.getLocale() to return the current selected Locale (it can be
>different from request.getLocale()).  (It'd be good also to move getLocale()
>to the new I18nUtils, but now getLocale() has a lot of dependencies from
>Cocoon, but I want to keep I18nUtils as much general as possible).
>
I was thinking about how to merge these two different sources for 
locale. Having request.getLocale() and LocaleAction.getLocale() 
returning different results is IMO a bad thing since it can lead to 
inconsistencies between components that use one method or the other.

We should have a single source for this information, and this is 
obviously the Request object.

So I see two possible solutions, but there might be other :
- having Request.getLocale() use the behaviour of LocaleAction.getLocale()
- adding Request.setLocale(Locale) to set the value returned by 
Request.getLocale(). This method would be called by LocaleAction.

What do you think ?

>Are there any other wishes/suggestions/comments regarding i18n?
>
Yes : use the "cocoon-" prefix for the "locale" request parameters, as 
for "cocoon-view" and "cocoon-action", to avoid potential naming conflicts,

I also had a look at the key lookup stuff (including XMLResourceBundle), 
and it seems to me it is really performance-killing. Since I also need 
pluggable sources for translations, I will take this subject if you 
don't mind.

Sylvain

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message