I am trying to internationalize an application, but when I try to change language, following warning appears:
WARNING: Using en_US for locale because expression /login.xhtml @15,41 locale="#{language.localeCode}" returned null.
It appears in the following line
<f:view locale="#{language.localeCode}">
Whole body of .xhtml file is within f:view
tag.
The bean it calls is:
@ManagedBean(name = "language")
@SessionScoped
public class LanguageHelper implements Serializable {
private static final long serialVersionUID = 1L;
private String localeCode;
public String getLocaleCode() {
return localeCode;
}
public void setLocaleCode(String localeCode) {
changeLang(localeCode);
}
public String changeLang(String langCode) {
localeCode = langCode;
FacesContext.getCurrentInstance().getViewRoot()
.setLocale(new Locale(langCode));
return null;
}
}
How can I fix this? I would be grateful for any info.