Hi,

>Laurie Harper wrote:
>
>Sebastian Göttschkes wrote:
>> Hi,
>> 
>> I'm experiencing strange behaviours with the message resources and I'm not 
>> sure about where to find the problem.
>> 
>> I defined the message resources in the struts-config.xml:
>> <!-- ==== Message Resources Definitions ==== -->
>> <message-resources 
>> parameter="com.equitystory.pms.resources.ApplicationResources" />
>> 
>> In the folder named in the xml 
>> (Resources/src/com/equitystory/pms/resources/), I created the following 
>> files:
>> ApplicationResources.properties
>> ApplicationResources_de.properties
>> 
>> When accessing the application with a browser "speaking" "de", I see the 
>> correct messages, but sometimes log4j is telling me that 
>> ApplicationResources_de_DE.properties is missing. I created this file and 
>> left it empty.
>> When accessing the application with an browser "pseaking" "en", the 
>> application is mixed up with german and english messages (as defined in the 
>> ApplicationResources). I created ApplicationResources_en.properties and left 
>> it empty, and now everything works fine. 
>> 
>> The problem I now got is what happens if someone with a browser "speaking" 
>> another language is accessing the application? It would be great if there 
>> would be an easier solution with just the two files I named above and struts 
>> using the default file if there is no language-specific file (e.g. 
>> "ApplicationResources_de.properties" for every browser speaking "de" and 
>> "ApplicationResources.properties" for all other languages).
>
>Everything *should* work just as you describe... You shouldn't need the 
>empty files, and resource lookup should automatically walk 'up' the 
>hierarchy from ApplicationResources_de_DE.properties to 
>ApplicationResources_de.properties to ApplicationResources.properties, 
>skipping files that don't exist and using the messages defined in the 
>most specific file that *does* exist.

>I would suggest deleting your empty files and then trying to determine 
>why you get a mixture of English and German when you're expecting to get 
>everything in one language or the other. It sounds like a problem with 
>how you have internationalized and/or localized the application -- e.g. 
>maybe you have some of your messages hard-coded still, or messages 
>missing from one of the properties files.

The strange thing is I didn't change anything except for the two empty files I 
created. So I can say that the problem isn't hard-coded text in the application 
or messages missing in one or the other resource. Maybe I got something wrong 
with the configuration? Is there another file where I have to configurate 
something related to the message resources except for the struts-config.xml I 
mentioned above?

Thanks,
Sebastian

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

Reply via email to