public static void applyUserSettings(Environment env,Map<String,Object> context) throws TemplateException {
  Locale locale=(Locale)context.get("locale");
  if (locale == null) {
    locale=Locale.getDefault();
  }
  env.setLocale(locale);
  TimeZone timeZone=(TimeZone)context.get("timeZone");
  if (timeZone == null) {
    timeZone=TimeZone.getDefault();
  }
  env.setTimeZone(timeZone);
}

public static void applyUserSettings ( Environment env , Map < String , Object > context ) throws TemplateException { Locale locale = ( Locale ) context . get ( "locale" ) ; if ( locale == null ) { locale = Locale . getDefault ( ) ; } env . setLocale ( locale ) ; TimeZone timeZone = ( TimeZone ) context . get ( "timeZone" ) ; if ( timeZone == null ) { timeZone = TimeZone . getDefault ( ) ; } env . setTimeZone ( timeZone ) ; }
apply user settings to an environment instance .
