• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with message resources

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have changed the brower language settings to other countries, i am not getting the required pages depending upon the languages changes. but i have observed that the .properties file present in the last is executing every time.

example:
<message-resources parameter="com/myapp/struts/ApplicationResource"/>
<message-resources parameter="com/myapp/struts/Application_fr"/>
<message-resources parameter="com/myapp/struts/Application_en"/>
<message-resources parameter="com/myapp/struts/Application_de"/>


so Application_de.properties file is executing ,
if i keep Application_fr.properties as the last line then the _fr.properties file is executing.

could any one help me.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've misunderstood how to define resource files. The name you define in the struts-config.xml file represents a bundle or group of files. The group is represented by a name without a language suffix. Struts will then append the appropriate language suffix when it determines which language the browser is set to use. So, your example, you should rename the file ApplicationResource.properties to Application.properties and change your struts-config.xml file so it has only the following entry for message resources:

Struts will then check the language of the browser and look for a file with the appropriate language suffix (e.g. Application_en.properties) and if it doesn't find that file it will use the default file of Application.properties.
 
shankar reddy
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone give the solution ...
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shankar reddy telukutla:
can anyone give the solution ...


It's a little disturbing that I spent my time posting an answer your question, and you don't even acknowledge that any response was given.

If you don't think this is the right solution, or you tried it and it didn't work, please let us know. It's a bit rude, though, to just pretend that no response was given.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay i dint know that the suffix for the country is added automatically..
now i might be asked to post it in a different thread but as the discussion is on , i just wanted to confirm do we have to have the .properties files along with other .class files?
and why is that so?
-Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic