Results 1 to 3 of 3

Thread: Fun with messages

  1. #1
    Join Date
    Aug 2006
    Posts
    221

    Default 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. #2
    Join Date
    Aug 2006
    Posts
    221

    Default

    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.

  3. #3
    Join Date
    Aug 2006
    Posts
    221

    Default 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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •