This is correct because if struts can't find a "key2" it in
ApplicationResources_de.properties (as your code is using) then it reverts
to the "default" language of the user (which is you) and since your
"default" language is Italian (as set in your browser) it uses that value.

Struts gets this from the HTTP headers.  If you want to verify this...

Try this:
1. Remove the "key2" from "ApplicationResources_it.properties" and see if it
pulls the one from "ApplicationResources.properties".
2. Undo step 1 and change your default language in your browswer.
     M$IE6.x - Menu = Tools -> Internet Options -> Languages button
     NS6     - Menu = Edit -> Preferences -> Navigator -> Languages


James Mitchell
Software Engineer
Open-Tools.org
Home Phone (770) 822-3359
Cell Phone: (678) 910-8017


-----Original Message-----
From: Ivan Siviero [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 1:53 PM
To: Struts Users Mailing List
Subject: bean message


I'm a  little bit puzzled about <bean:message> behaviour.
Let's suppose the following situation

ApplicationResources.properties
key1=defaultKey1
key2=defaultKey2

ApplicationResources_de.properties
key1=germanKey1

ApplicationResources_it.properties
key1=italianKey1
key2=italianKey2

To switch the locale i do the following:

request.getSession().setAttribute( Action.LOCALE_KEY,  myLocale );
Let's suppose myLocale is the German locale ( new Locale( "de", "DE") )

<bean:message key="key1"> works fine
<bean:message key="key2"> returns the italianKey2

I was expecting the string 'defaultKey2', why do i get the italian !??!

Another question is: if i create a locale like new Locale ("en", "EN"),
what's the output of  <bean:message key="key2"> ?
my answer would be defaultKey2 but of course i'm wrong as it returns the
italian one !
I will end up to code my personal bean:message tag !!!
Bye
IVan.


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


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to