Could someone tell me why locale Finnish is not working and the rest are?
private static Map<String,Object> countries;
private static Locale finnishLocale = new Locale("fi", "FI");
static{
countries = new LinkedHashMap<String,Object>();
countries.put("English", Locale.ENGLISH); //label, value
countries.put("French", Locale.FRENCH);
countries.put("German", Locale.GERMAN);
countries.put("Finnish", finnishLocale); <---------- Not working!
}
public void setLocaleCode(String localeCode) {
this.localeCode = localeCode;
updateLocale(localeCode);
}
public void updateLocale(String newLocale){
String newLocaleValue = newLocale;
//loop country map to compare the locale code
for (Map.Entry<String, Object> entry : countries.entrySet()) {
if(entry.getValue().toString().equals(newLocaleValue)){
FacesContext.getCurrentInstance()
.getViewRoot().setLocale((Locale)entry.getValue());
}
}
}
I mean that the locale which I created with New-clause is not working. I can't explain it better, because I thought that locale implemented like that is similar Locale-object than for instance Locale.GERMAN? My software doesn't do anything else than update locale ja Faces context. There is no exceptions. Sorry if the q is stupid. Everything else is working, I mean German, English etc and the program updates the locale and Faces context.
I would be very much appreciated if you answer the question, I am lost (again) Sami