ytrstu / vosao

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
0 stars 0 forks source link

MissingResourceException for browser locale #269

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Because my browser has locale de_DE I get this exception on the login page:

WARNUNG: /i18n.js
java.util.MissingResourceException: Can't find bundle for base name 
org.vosao.resources.messages, locale de_DE
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1508)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1262)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:789)
    at org.vosao.i18n.VosaoResourceBundle.getResourceBundles(VosaoResourceBundle.java:99)
    at org.vosao.i18n.VosaoResourceBundle.getKeys(VosaoResourceBundle.java:60)
    at org.vosao.i18n.Messages.getJSMessages(Messages.java:108)
    at org.vosao.servlet.JSBundleServlet.doGet(JSBundleServlet.java:44)

As a workaround I renamed messages_en.properties to messages.properties

Original issue reported on code.google.com by axelclk@gmail.com on 20 Jul 2010 at 9:14

GoogleCodeExporter commented 9 years ago
Please provide Vosao CMS version. I've checked this on 0.6.6 on 
http://vosaocms.appspot.com and it is OK.

Original comment by kinyelo@gmail.com on 21 Jul 2010 at 5:12

GoogleCodeExporter commented 9 years ago
I've used this with latest SVN and had also problems with message bundles from 
rssatom plugin.

Why don't you simply follow the convention described here
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html
and rename the "messages_en.properties" to "messages.properties"

Execerpt from ResourceBundle.html Javadoc:
"Resource bundles belong to families whose members share a common base name, 
but whose names also have additional components that identify their locales. 
For example, the base name of a family of resource bundles might be 
"MyResources". The family should have a default resource bundle which simply 
has the same name as its family - "MyResources" - and will be used as the 
bundle of last resort if a specific locale is not supported. The family can 
then provide as many locale-specific members as needed, for example a German 
one named "MyResources_de". "

Original comment by axelclk@gmail.com on 25 Jul 2010 at 11:56

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by kinyelo@gmail.com on 25 Jul 2010 at 12:07

GoogleCodeExporter commented 9 years ago
Thanks for the fix.

Could you please also change the rssatom resources and rename the 
"messages_en.properties" to "messages.properties"?

Original comment by axelclk@gmail.com on 25 Jul 2010 at 12:41

GoogleCodeExporter commented 9 years ago
Done.

Original comment by kinyelo@gmail.com on 25 Jul 2010 at 2:48