I'd try overwriting the struts Locale in Globals.LOCALE_KEY when the user
clicks on a flag. I don't know if that will work, but I'd try it.

I'd also give careful consideration to just using the browsers requested
language, rather than making the user choose one explicitly.
Paul

> -----Original Message-----
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 7:24 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Language resource bundles problem
> 
> 
> Another related problem...
> 
> I've gotten this working as you state fine now.  I have a 
> session attribute, 
> countryCode, that is literally just EN, DE, etc.  I have some 
> images of 
> flags, when you click one it calls an action that sets the 
> appropriate code 
> in session (I also do this in the first Action called in my 
> app, defaulting 
> to EN).
> 
> Here's my question... in my JSP's, when using <bean:message>, 
> I know that I 
> can specify bundle="en" or bundle="de" and that works, but 
> how can I set the 
> bundle attribute to a variable value, namely the value of the session 
> attribute countryCode?
> 
> Thanks again!
> 
> 
> >From: Paul McCulloch <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: Language resource bundles problem
> >Date: Thu, 13 May 2004 16:47:00 +0100
> >
> >You are calling the getMessage(String, Object) method. The 
> String is the 
> >key
> >& the object is a substitution paramter (i.e. {0}).
> >
> >You want the getMessage(Locale, String) method. You can 
> eaither create a
> >Locale from 'de' or get the users first requested locale with
> >"request.getSession().getAttribute(Globals.LOCALE_KEY);"
> >
> >HTH,
> >
> >Paul
> >
> > > MessageResources mr = getResources(request);
> > > myActionForm.setMessage(mr.getMessage("messages.deleteFailed"));
> > >
> > > Now, this works just fine.  My message is displayed as a
> > > result of the
> > > onLoad event of my page via a simple JavaScript alert 
> box.  Very cool.
> > >
> > > However, if I want to display the message from the German
> > > resource file, I
> > > can't get it to work.  I thought all I had to do was this:
> > >
> > > myActionForm.setMessage(mr.getMessage("de", 
> "messages.deleteFailed"));
> > >
> >
> >
> >
> >*************************************************************
> *********
> >Axios Email Confidentiality Footer
> >Privileged/Confidential Information may be contained in this 
> message. If 
> >you are not the addressee indicated in this message (or 
> responsible for 
> >delivery of the message to such person), you may not copy or 
> deliver this 
> >message to anyone. In such case, you should destroy this 
> message, and 
> >notify us immediately. If you or your employer does not 
> consent to Internet 
> >email messages of this kind, please advise us immediately. Opinions, 
> >conclusions and other information expressed in this message 
> are not given 
> >or endorsed by my Company or employer unless otherwise 
> indicated by an 
> >authorised representative independent of this message.
> >WARNING:
> >While Axios Systems Ltd takes steps to prevent computer 
> viruses from being 
> >transmitted via electronic mail attachments we cannot guarantee that 
> >attachments do not contain computer virus code.  You are 
> therefore strongly 
> >advised to undertake anti virus checks prior to accessing 
> the attachment to 
> >this electronic mail.  Axios Systems Ltd grants no 
> warranties regarding 
> >performance use or quality of any attachment and undertakes 
> no liability 
> >for loss or damage howsoever caused.
> >*************************************************************
> *********
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _________________________________________________________________
> Express yourself with the new version of MSN Messenger! 
> Download today - 
> it's FREE! http://messenger.msn.com/go/onm00200471ave/direct/01/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**********************************************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**********************************************************************


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

Reply via email to