ResourceBundles expect language codes to be lowercase and country codes to be uppercase in the property file name. So the filename should be 'message_US.properties' or 'message_en_US.properties'. The JavaDocs for ResourceBundle.getBundle() JavaDocs show what order different combinations will be loaded in. The JavaDocs for Locale links lists of valid language and country codes.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
posted 9 years ago
Thanks. It is working fine when I changed my properties file name from 'msgbundle_us.properties' to 'msgbundle_en_US'.I have another project that uses canadian english. So i have the properies file name as 'msgbundle_en_CA'. I am getting same WARNING 'ResourceBundle [msgbundle] not found for MessageSource: Can't find bundle for base name message, locale en_US'.
How can i get rid of this message here? I may not have en_US properties file in my project. My project is in Spring framework.