};
List<Locale> availableLanguages = I18n.findAvailableLanguages();
for (final Locale locale: availableLanguages) {
- I18nAction languageAction = new I18nAction("general.language." + locale.getLanguage(), IconLoader.loadIcon("/flag-" + locale.getLanguage() + ".png")) {
+ String language = locale.getLanguage();
+ I18nAction languageAction = new I18nAction("general.language." + language, IconLoader.loadIcon("/flag-" + language + ".png")) {
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent e) {
}
};
- if (I18n.getLocale().getLanguage().equals(locale.getLanguage())) {
+ if (I18n.getLocale().getLanguage().equals(language)) {
languageAction.setEnabled(false);
}
languageActions.add(languageAction);