Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

i18n Internationization HELP! :)

 
Caliph Herald
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am atempting to give my application multi-language support.

I have 4 resource bundles set up in struts-config.xml:

<message-resources parameter="view.application"/>
<message-resources parameter="view.application_en"/>
<message-resources parameter="view.application_de"/>
<message-resources parameter="view.application_es"/>


i set the locale to true in jsp:
<html:html locale="true">
...
</html:html>

i thought that struts would see the locale set in the browsers request object and set the correct resouce bundle accordingly. It does not. It appears to set what ever is the LAST bundle registered in the struts-config.xml. Meaning if I placed the "view.application_de" bundle last , THAT is the bundle that would be used reguardless of the locale in the request object.

please advise

[ February 21, 2006: Message edited by: Caliph Herald ]
[ February 21, 2006: Message edited by: Caliph Herald ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should only have one <message-resources> tag, not four.

<message-resources parameter="view.application"/>

You do still need four properties files. Struts will append the appropriate suffix for the locale when it's looking for a properties file to use.
 
Caliph Herald
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Merrill, it worked like a charm! Is there anyway around having re-start the browser to see the change?
[ February 22, 2006: Message edited by: Caliph Herald ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I don't believe there's a way around restarting the browser after changing the default locale.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic