You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Johan Peeters <jo...@alcatel.be> on 2000/07/10 11:47:53 UTC

i18n

I am having trouble configuring my application with alternate resource
bundles. I have a properties file 'ApplicationResources.properties' from
which struts messages are pulled, just like in the Struts example
application. I have added a file (same directory) called
'ApplicationResources_nl_BE.properties'. Since I configured my browser
to give preference to the nl_BE locale, I expect that the messages in
the latter properties file would be used, but they are not. This does
not seem to be specific to my application: when I similarly add
ApplicationResources_nl.properties to the Struts example, the default
resource bundle continues to be used.
Am I missing something or does the struts:message tag not support yet?

Many Thanks,

Yo

--
Johan Peeters mailto:johan.peeters@alcatel.be
Software Architect - Net Commerce
Alcatel - Gen. De Wittelaan 11 A bus 1 - 2800 Mechelen - Belgium
Phone: +32 15 29 3427 Fax: +32 3 240 4800



Re: i18n

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Johan Peeters wrote:

> I am having trouble configuring my application with alternate resource
> bundles. I have a properties file 'ApplicationResources.properties' from
> which struts messages are pulled, just like in the Struts example
> application. I have added a file (same directory) called
> 'ApplicationResources_nl_BE.properties'. Since I configured my browser
> to give preference to the nl_BE locale, I expect that the messages in
> the latter properties file would be used, but they are not. This does
> not seem to be specific to my application: when I similarly add
> ApplicationResources_nl.properties to the Struts example, the default
> resource bundle continues to be used.
> Am I missing something or does the struts:message tag not support yet?
>

At the moment, Struts does not pay direct attention to the "Accept-Language"
header that your browser sends when it is configured for specific language
preferences.  Instead, it assumes that you have stored a java.util.Locale
object in the user's session, under key "org.apache.struts.action.LOCALE"
(i.e. the value of Action.LOCALE_KEY in the org.apache.struts.action.Action
interface) to identify the user's current preferences.  If no locale is
found here, Struts defaults to the server's default locale.

Paying attention to the Accept-Language header is something that you ought
to be able to configure Struts to do, and I will be looking into that.

>
> Many Thanks,
>
> Yo
>

Craig McClanahan