0 Replies Latest reply: Jul 29, 2009 3:31 AM by 843810 RSS

    JSF and internationalization

    843810
      Hello evry body,
      to change the local of my web application i've done the code below :


      public void processChangeLocal(ValueChangeEvent event){
      Locale newLocal = new Locale( (String)event.getNewValue());
      FacesContext context = FacesContext.getCurrentInstance();
      context.getViewRoot().setLocale(newLocal);
      context.getApplication().setDefaultLocale(newLocal);
      }

      This method is called when the user changes the language. By my problem is only the local of the currente page changes.

      i've done this in the faces-config :

      <locale-config>
      <default-locale>fr</default-locale>
      <supported-locale>fr</supported-locale>
      <supported-locale>en</supported-locale>
      </locale-config>