From bd87e5553b8a6f272f81bc2ed9ce24226945042b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 26 Jun 2017 22:10:01 +0200 Subject: [PATCH] Bundle.loadBundle() being called here means that also the bundle file(s) must be present in this project (and resulting JAR file). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- src/org/mxchange/jcoreee/bean/BaseBean.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/org/mxchange/jcoreee/bean/BaseBean.java b/src/org/mxchange/jcoreee/bean/BaseBean.java index 2bb3734..772ef69 100644 --- a/src/org/mxchange/jcoreee/bean/BaseBean.java +++ b/src/org/mxchange/jcoreee/bean/BaseBean.java @@ -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. + *

+ * @param locale Locale from e.g. FacesContext + *

+ * @return Initialized and loaded resource bundle + */ + protected abstract ResourceBundle loadResourceBundle (final Locale locale); + /** * Sends given message to configured queue *

@@ -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 -- 2.39.5