LocalizationSetterImpl implements LocalizationSetter { public SelectModel getSupportedLocalesModel() { List<OptionModel> options = CollectionFactory.newList(); for (Locale l : supportedLocales) { options.add(new OptionModelImpl(l.getDisplayName(l), l)); } return new SelectModelImpl(null, options); } LocalizationSetterImpl(Request request,

    PersistentLocale persistentLocale,

    ThreadLocale threadLocale,

    @Symbol(SymbolConstants.SUPPORTED_LOCALES)
    String localeNames); Locale toLocale(String localeName); boolean setLocaleFromLocaleName(String localeName); void setNonPersistentLocaleFromLocaleName(String localeName); List<Locale> getSupportedLocales(); boolean isSupportedLocaleName(String localeName); SelectModel getSupportedLocalesModel();  }
@Test public void get_locale_model() { LocalizationSetter setter = new LocalizationSetterImpl(null, null, null, "en,fr"); SelectModel model = setter.getSupportedLocalesModel(); assertNull(model.getOptionGroups()); List<OptionModel> options = model.getOptions(); assertEquals(options.size(), 2); assertEquals(options.get(0).getLabel(), "English"); assertEquals(options.get(1).getLabel(), "fran\u00e7ais"); assertEquals(options.get(0).getValue(), Locale.ENGLISH); assertEquals(options.get(1).getValue(), Locale.FRENCH); }