You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Miren Urkijo <mi...@tinieblas.com> on 2005/11/20 11:36:34 UTC

help for changing the language, locale

HEllo y havo one struts aplicaicon.
if into the borwser i change the locale, into the browser properties, my application load the properties files well.
i am thinking for making onw struts action for changing the language, thelocale but i dont knows how to change it.
can anybody says me how must i make it?
thanks

Re: help for changing the language, locale

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Note that there is a LocaleAction specifically for doing this, so you 
don't even have to remember how :)  It appears in 1.2.4 at least, but 
I'm not sure when it was first introduced.

Frank

Danny Lee wrote:
> Well,
> 
> that's really easy, just do:
> 
> "request.getSession().setAttribute(Globals.LOCALE_KEY, new 
> locale(languageCode));"
> 
> in your action, where languageCode is the locale you wish to use.
> 
> Cheers
> 
> Danny
> 
> 
> 
> Miren Urkijo schrieb:
> 
>> HEllo y havo one struts aplicaicon.
>> if into the borwser i change the locale, into the browser properties, 
>> my application load the properties files well.
>> i am thinking for making onw struts action for changing the language, 
>> thelocale but i dont knows how to change it.
>> can anybody says me how must i make it?
>> thanks
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> .
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: help for changing the language, locale

Posted by Danny Lee <ha...@yahoo.de>.
You have to do a getLocale() in your ActionForm and then
use:

<fmt:setLocale value = "${YourActionForm.locale}"/> in your JSP ;)

Then you gonna be lucky ;)

Cheers,

Danny


Miren Urkijo schrieb:
> it runsbut i have one problem.
> in my struts pages i am working with fmt and jstl and this doesn't run 
> with these (jstl, fmt).
> which is the solution?
> can anybody helps me?
> thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: help for changing the language, locale

Posted by Ray Madigan <ra...@madigans.org>.
You change the language using

<fmt:setLocale value='en'/> for English.
then you need the resource bundles for resource_en.properties that fmt looks
up

For example
<fmt:setBundle basename='Foo'/>

needs file Foo_en.properties in the WEB-INF/classes directory of your
webapp.

For your application you would use a <c:choose tag to switch on the local
and setLocale appropriatly.

Hope this helps

-----Original Message-----
From: Miren Urkijo [mailto:miren@tinieblas.com]
Sent: Sunday, November 20, 2005 9:19 AM
To: Struts Users Mailing List
Subject: Re: help for changing the language, locale


it runsbut i have one problem.
in my struts pages i am working with fmt and jstl and this doesn't run with
these (jstl, fmt).
which is the solution?
can anybody helps me?
thanks
----- Original Message -----
From: "Danny Lee" <ha...@yahoo.de>
To: <us...@struts.apache.org>
Sent: Sunday, November 20, 2005 2:24 PM
Subject: Re: help for changing the language, locale


> Well,
>
> that's really easy, just do:
>
> "request.getSession().setAttribute(Globals.LOCALE_KEY, new
> locale(languageCode));"
>
> in your action, where languageCode is the locale you wish to use.
>
> Cheers
>
> Danny
>
>
>
> Miren Urkijo schrieb:
>> HEllo y havo one struts aplicaicon.
>> if into the borwser i change the locale, into the browser properties, my
>> application load the properties files well.
>> i am thinking for making onw struts action for changing the language,
>> thelocale but i dont knows how to change it.
>> can anybody says me how must i make it?
>> thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: help for changing the language, locale

Posted by Miren Urkijo <mi...@tinieblas.com>.
it runsbut i have one problem.
in my struts pages i am working with fmt and jstl and this doesn't run with 
these (jstl, fmt).
which is the solution?
can anybody helps me?
thanks
----- Original Message ----- 
From: "Danny Lee" <ha...@yahoo.de>
To: <us...@struts.apache.org>
Sent: Sunday, November 20, 2005 2:24 PM
Subject: Re: help for changing the language, locale


> Well,
>
> that's really easy, just do:
>
> "request.getSession().setAttribute(Globals.LOCALE_KEY, new 
> locale(languageCode));"
>
> in your action, where languageCode is the locale you wish to use.
>
> Cheers
>
> Danny
>
>
>
> Miren Urkijo schrieb:
>> HEllo y havo one struts aplicaicon.
>> if into the borwser i change the locale, into the browser properties, my 
>> application load the properties files well.
>> i am thinking for making onw struts action for changing the language, 
>> thelocale but i dont knows how to change it.
>> can anybody says me how must i make it?
>> thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: help for changing the language, locale

Posted by Danny Lee <ha...@yahoo.de>.
Well,

that's really easy, just do:

"request.getSession().setAttribute(Globals.LOCALE_KEY, new 
locale(languageCode));"

in your action, where languageCode is the locale you wish to use.

Cheers

Danny



Miren Urkijo schrieb:
> HEllo y havo one struts aplicaicon.
> if into the borwser i change the locale, into the browser properties, my application load the properties files well.
> i am thinking for making onw struts action for changing the language, thelocale but i dont knows how to change it.
> can anybody says me how must i make it?
> thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: help for changing the language, locale

Posted by Simons Kevin <fb...@skynet.be>.
I don't know how you could do this. But perhaps you can create a struts 
action that loads the correct locale properties file. Just an opinion.

regards,
----- Original Message ----- 
From: "Miren Urkijo" <mi...@tinieblas.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Sunday, November 20, 2005 11:36 AM
Subject: help for changing the language, locale


HEllo y havo one struts aplicaicon.
if into the borwser i change the locale, into the browser properties, my 
application load the properties files well.
i am thinking for making onw struts action for changing the language, 
thelocale but i dont knows how to change it.
can anybody says me how must i make it?
thanks


--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 18/11/2005



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 18/11/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org