Commits

plightbo  committed f078714

i18n now looks for hierarchy of package.properties as well

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@234e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 915c168

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork/util/LocalizedTextUtil.java

             }
         }
 
+        // nothing still? alright, search the package hierarchy now
+        clazz = aClass;
+
+        do {
+            try {
+                String packageName = clazz.getPackage().getName();
+                ResourceBundle bundle = findResourceBundle(packageName + ".package", locale);
+                reloadBundles(bundle);
+                String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
+
+                return MessageFormat.format(message, args);
+            } catch (MissingResourceException ex) {
+                clazz = clazz.getSuperclass();
+            }
+        } while (!clazz.equals(Object.class));
+
+
         return getDefaultText(aTextName, locale, valueStack, args, defaultMessage);
     }