Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.errai.ui.client.widget;
 
 

Author(s):
edewit@redhat.com
public class LocaleSelector {
  public static final String DEFAULT = "default";
    Set<LocalesupportedLocales = new HashSet<Locale>();
    final TranslationService translationService = TemplateUtil.getTranslationService();
    final Collection<Stringlocales = translationService.getSupportedLocales();
    for (String localeKey : locales) {
      localeKey = localeKey == null ?  : localeKey;
      supportedLocales.add(new Locale(localeKeytranslationService.getTranslation(localeKey)));
    }
    return supportedLocales;
  }
  public void select(String locale) {
    TranslationService.setCurrentLocale(locale);
  }
New to GrepCode? Check out our FAQ X