You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Niall Lynch <Ni...@aerlingus.com> on 2004/03/29 16:13:41 UTC

Hi all,

Hi all,

I'm having a problem with the i18n:bundle tag. 

I set the locale on the session in an action based on a user
selection:

request.getsession().setAttribute(Action.LOCALE_KEY, userLocale);

where userLocale is a Locale object representing the value selected by
the user.

In my JSP I set the Bundle as follows:

<i18n:bundle baseName="presentation.resources.ApplicationMessages" 
             locale="<%= (Locale)
session.getAttribute(Action.LOCALE_KEY)%>" 
             id="bundle" />

User locale from bundle = <%=bundle.getLocale() %>

No matter what value I set the userLocale to, the bundle locale is
always en. 

I have also tried using localeRef and I get the same result. 

When I print out the session attribute directly in the JSP as follows
it displays the correct locale:

User Locale from Session is <%= session.getAttribute(Action.LOCALE_KEY)
%>


I'm using the i18n message tag as follows:

<i18n:message key="label.username" bundleRef="bundle" />

Is there a problem in setting locale of the bundle Reference? 

Hope you can help,

Regards,

Niall.



For low fares and great deals on hotels, car hire and travel insurance visit http://www.aerlingus.com
*******************************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.  Any review, dissemination or other use of, or taking
of any action in reliance upon, this information by persons or entities
other than the intended recipient is prohibited.If you have received
this email in error please notify the sender immediately and delete
the material.
*******************************************************************************


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