- this.setLocale(new Locale(language));
- FacesContext.getCurrentInstance().getViewRoot().setLocale(this.getLocale());
+ // Log trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("JobsLocalizationSessionBean::setLanguage: language={0} - CALLED!", language)); //NOI18N
+
+ // Language splits
+ String[] splits = language.split("_");
+ if (null == splits[1]) {
+ splits[1] = "";
+ }
+
+ // Get new locale with upper-case country code
+ Locale loc = new Locale(splits[0], splits[1]);
+
+ // Log debug message
+ this.getLoggerBeanLocal().logDebug(MessageFormat.format("JobsLocalizationSessionBean::setLanguage: loc={0}", loc)); //NOI18N
+
+ // Set it here and in the JSF context
+ this.setLocale(loc);
+ FacesContext.getCurrentInstance().getViewRoot().setLocale(loc);
+
+ // Log trace message
+ this.getLoggerBeanLocal().logTrace("JobsLocalizationSessionBean::setLanguage: EXIT!"); //NOI18N