]> git.mxchange.org Git - jcore-utils.git/commitdiff
Bundle.loadBundle() being called here means that also the bundle file(s) must
authorRoland Häder <roland@mxchange.org>
Mon, 26 Jun 2017 20:10:01 +0000 (22:10 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 26 Jun 2017 20:10:01 +0000 (22:10 +0200)
be present in this project (and resulting JAR file).

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcoreee/bean/BaseBean.java

index 2bb3734c6931c4988aed6f79030997c6bcd0dc77..772ef69c832f1c41ea4669328670e4ac67243af6 100644 (file)
@@ -247,6 +247,18 @@ public abstract class BaseBean implements Serializable {
                return isEnabled;
        }
 
+       /**
+        * Loads resource bundle for given locale. This must be implemented per
+        * project so all projects can still customize their methods. Calling
+        * ResourceBundleloadBundle() in this class means that also the bundle files
+        * must be present here.
+        * <p>
+        * @param locale Locale from e.g. FacesContext
+        * <p>
+        * @return Initialized and loaded resource bundle
+        */
+       protected abstract ResourceBundle loadResourceBundle (final Locale locale);
+
        /**
         * Sends given message to configured queue
         * <p>
@@ -315,7 +327,7 @@ public abstract class BaseBean implements Serializable {
                Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
 
                // Get bundle bundle
-               ResourceBundle bundle = ResourceBundle.getBundle("org.mxchange.localization.bundle", locale);
+               ResourceBundle bundle = this.loadResourceBundle(locale);
 
                // Default is i18nKey
                String message = MessageFormat.format("!{0}!", i18nKey); //NOI18N