[jsword-svn] r2082 - trunk/jsword/src/main/java/org/crosswire/common/util

dmsmith at crosswire.org dmsmith at crosswire.org
Wed Mar 2 20:31:39 MST 2011


Author: dmsmith
Date: 2011-03-02 20:31:38 -0700 (Wed, 02 Mar 2011)
New Revision: 2082

Modified:
   trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java
Log:
JS-167 Allow msg.properties to be found in the standard JSword locations.

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java	2011-03-01 13:59:20 UTC (rev 2081)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java	2011-03-03 03:31:38 UTC (rev 2082)
@@ -110,6 +110,7 @@
     protected final void loadResources() {
         Class<? extends MsgBase> implementingClass = getClass();
         String className = implementingClass.getName();
+        String shortClassName = ClassUtil.getShortClassName(className);
 
         // Class lock is needed around static resourceMap
         synchronized (MsgBase.class) {
@@ -120,12 +121,15 @@
             if (resources == null) {
                 Locale defaultLocale = Locale.getDefault();
                 try {
-                    resources = ResourceBundle.getBundle(className, defaultLocale, CWClassLoader.instance(implementingClass));
+                    resources = ResourceBundle.getBundle(shortClassName, defaultLocale, CWClassLoader.instance(implementingClass));
                     resourceMap.put(className, resources);
                 } catch (MissingResourceException ex) {
                     log.warn("Assuming key is the default message " + className);
                 }
             }
+            if (resources == null) {
+                log.error("Missing resources: Locale=" + Locale.getDefault().toString() + " class=" + className);
+            }
         }
     }
 




More information about the jsword-svn mailing list