Announcement Announcement Module
Collapse
No announcement yet.
Fun with messages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fun with messages

    I'm chasing my tail on this one.

    It all starts with the fact that internationalizing spring requires us to have multiple message files for English (US), English(CA), English(GB) even though these are all the same messages.

    I looked through the docs and couldn't find anything that Spring would help me out with this. I will probably open a JIRA for future enhancement.

    So to keep my app from blowing up when someone else comes in from Canada, I feed it a list of valid locales and have it replicate the ones it can find to others it can't of the same language.

    To do all of this, I use getResource on the class loader to find the messages file and make copies of it appropriately. This worked great in my junit test.

    Problem is that the custom class loader used by Spring doesn't seem to be finding the messages_en_US.properties file, even though Spring finds it just fine.

    I'm not sure what I'm expecting others to help with. Sage advice, perhaps?

    Thanks.

  • #2
    I ended up using getBundleClassLoader on ResourceBundleMessageSource. This gave me the ClassLoader I needed to call getResource on and found my properties files for me.

    Comment


    • #3
      Jira

      I have created Spring JIRA SPR-3711 for this enhancement. If you found this doing a search, please vote for this JIRA at:

      http://opensource.atlassian.com/proj...rowse/SPR-3711

      Thanks!

      Comment

      Working...
      X