package com.corejsf;

import java.util.Locale;

import javax.inject.Named; 
   // lub import javax.faces.bean.ManagedBean;
import javax.enterprise.context.RequestScoped; 
   // lub import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

@Named // lub @ManagedBean
@RequestScoped
public class LocaleChanger {
   public String changeLocale(String languageCode) {
      FacesContext context = FacesContext.getCurrentInstance();
      context.getViewRoot().setLocale(new Locale(languageCode));
      return null;
   }
}
