My understanding of it (which could be incorrect) is that setLocale(request,
locale) only sets the locale that Struts uses internally.  It doesn't set the
locale that the request object uses, or any other processes that looks for
locale in the request object.
If you somehow need the locale that you've set in this code, call "locale =
(Locale) request.getSession().getAttribute(Globals.LOCALE_KEY);" in Struts
1.1, or "RequestUtils.getUserLocale(request, null);" in 1.2.

Hubert

--- Hernan Soulages <[EMAIL PROTECTED]> wrote:
> I sent a message asking about a problem with setLocale. Since I haven't
> received any anwser, I think one of three thing has happened:
> - You didn't receive it.
> - It was too stupid a question to bother anwsering (hope not!).
> - Nobody has a cleu of what is happening to me.
> Wichever is the case, please anwser so I know I'm getting throught.
> Regards
> Hernan
> 
> > Hi. I have been trying to get to work the i18n in an application I'm
> > working on and can't make it work. I found something wrong in the
> > setLocale. In the login Action I'm using the following code:
> > ---
> >     LoginAdminForm f = (LoginAdminForm) form;
> >
> >     if (f.getLang().equals("es")) {
> >             Locale local = new Locale("es");
> >             System.out.println("Espanol: " + local.getLanguage() + "_" +
> > local.getCountry() );
> >             setLocale(request, local);
> >     }else if (f.getLang().equals("pt")){
> >             Locale local = new Locale("pt");
> >             System.out.println("Portugues: " + local.getLanguage() + "_" +
> > local.getCountry());
> >             setLocale(request, local);
> >     }
> >     System.out.println(request.getLocale().getLanguage() + "_" +
> > request.getLocale().getCountry());
> > ---
> >
> > When I select Spanish (f.getLang() equals "es"), I get
> > Espanol: es_
> > en_
> > in the server console. So the setLocale(request, local) isn't working.
> Any
> > ideas why?
> > I'm using Tomcat 5.0.19 and Struts 1.1
> >
> > Thanks in advance
> > Hernan



        
                
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

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

Reply via email to