cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Locale Bug in CForm Form.java ?
Date Thu, 11 Aug 2005 12:34:57 GMT
Thomas Lutz wrote:
> Hi list !
> 
> Short summary: I am not sure wether this line in Form.java is correct:
> 
> private Locale locale = Locale.getDefault();
> 
> This is taken from the member variable declarations...
> 
> It takes the default locale from the host, but shouldn't it take the 
> locale set via the browser or the LocaleAction.java ? So the line should 
> rather be something like:
> 
> 
> private Locale locale = I18nUtils.findLocale(....); ?
> 
> Not sure what to put into the (...) put I guess this would return the 
> user agents locale...?
> 
> I tried the i18n samples as well as my own cocoon app, and no matter 
> what language I set in firefox or locale I specify via the LocaleAction, 
> the form is always running with the en_US locale from my cocoon server.

in your own cocoon webapp you can do:
var form = new Form( "cocoon:/form-def/" + config.filterModelName );
form.locale = determineLocale();

and implement determineLocale() with any logic you like.

For cocoon samples: we should probably make use of LocaleAction.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message