private void createDefaultItem() throws Exception
{
UIPortal uiPortal = Util.getUIPortal();
LocaleConfigService localeConfigService = getApplicationComponent(LocaleConfigService.class);
Collection<?> listLocaleConfig = localeConfigService.getLocalConfigs();
LocaleConfig defaultLocale = localeConfigService.getDefaultLocaleConfig();
String defaultLanguage = defaultLocale.getLanguage();
Locale currentLocate = Util.getPortalRequestContext().getLocale();
Iterator<?> iterator = listLocaleConfig.iterator();
while (iterator.hasNext())
{
LocaleConfig localeConfig = (LocaleConfig)iterator.next();
SelectItemOption<String> option =
new SelectItemOption<String>(localeConfig.getLocale().getDisplayName(currentLocate), localeConfig
.getLanguage());
if (defaultLanguage.equals(localeConfig.getLanguage()))
{
option.setSelected(true);
}
languages.add(option);
}