You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ulrich Winter <ul...@100world.de> on 2001/04/19 16:45:41 UTC

bug? resource bundle is not automatically changed

Hello!

We're using the <bean:message /> tag 
to display localizable messages.

The message is displayed in the default locale which was active when the
web server was started.
I thought struts would use the correct resource bundle automatically!
Isn't that true?

What we did to get the correct language was
    session.setAttribute(org.apache.struts.action.Action.LOCALE_KEY,
request.getLocale());
in the jsp pages.

This works, but I suggest struts should do this automatically.

Greetings,
Uli


Re: bug? resource bundle is not automatically changed

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 19 Apr 2001, Ulrich Winter wrote:

> Hello!
> 
> We're using the <bean:message /> tag 
> to display localizable messages.
> 
> The message is displayed in the default locale which was active when the
> web server was started.
> I thought struts would use the correct resource bundle automatically!
> Isn't that true?
> 
> What we did to get the correct language was
>     session.setAttribute(org.apache.struts.action.Action.LOCALE_KEY,
> request.getLocale());
> in the jsp pages.
> 
> This works, but I suggest struts should do this automatically.
> 

It will do so automatically, if you tell it to:

* For requests submitted to the controller servlet, enable this
  feature by setting the "locale" initialization parameter to "true".

* For JSP pages, use the provided custom tag to replace <html> .. </html>:

  <html:html locale="true">
    ... content of your page ...
  </html:html>

> Greetings,
> Uli
> 
> 

Craig