javaserverfaces-spec icon indicating copy to clipboard operation
javaserverfaces-spec copied to clipboard

Change locale is not working

Open sotobotero opened this issue 5 years ago • 1 comments

I need change locale in order to implement internationalization (i18n), but it no work, JSF always take browser locale. Any way to do it?

Locale LOCALE = Locale("es", "ES"); ResourceBundle.clearCache(); ResourceBundle.clearCache(Thread.currentThread().getContextClassLoader()); ResourceBundle bundle = BResourceBundle.getBundle(DBResourceBundle.class.getName()); //set locale not work on JSF 2, it take Locale from web browser // FacesContext.getCurrentInstance().getViewRoot().setLocale(LOCALE);

--------faces-config.xml------ org.altamira.ada.core.i18n.handler.DBResourceBundle bundle

    <locale-config>
        <default-locale>en</default-locale>
        <supported-locale>es</supported-locale>           
       <!-- <supported-locale>ar</supported-locale>-->
    </locale-config>  

sotobotero avatar Mar 15 '20 11:03 sotobotero

This repository, as I understand, is about the specification and not issues with implementations. You might want to re-ask this over there on Stackoverflow.

Quix0r avatar Apr 12 '20 19:04 Quix0r