Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Resource Bundle in XML Config file

 
M A Mujeeb
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have followed this thread

http://forum.springsource.org/showthread.php?t=73426

and was successful in accessing the resource bundle in the xml file. However the problem i face is accessing a language specific resource bundle.




I am only able to access the latest specified property ie; resource_ar.properties;

When I set locale to FR, I should be able to access resource_fr.properties; How do i do this? How do i make the xml file access locale specific resource file dynamically.

Thanks.
 
Mark Secrist
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't believe PropertyPlaceholderConfigurer was meant to be used in an I18N scenario. In this case, you probably want to consider something from the resource bundle interfaces like ResourceBundleMessageSource or ReloadableResourceBundleMessageSource. In that case, you may need to find another way to set the property on your beans as it won't work in the context of the XML config file processing.
 
M A Mujeeb
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,

Thanks for your input. I feel you are right.
 
Raghu Devatha
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does one want to inject multiple i18n resource bundles. Should that not be part of implementation.
Unrelated but, I was just curious.

As I understand, PropertyPlaceholderConfigurer is for injecting the application properties. I guess org.springframework.context.support.ResourceBundleMessageSource should be used for loading i18n messages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic