From: David ‘Bombe’ Roden Date: Wed, 28 May 2008 11:56:30 +0000 (+0200) Subject: use variable for recurring function call X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e530db1c8890cb1eb3acda532cfee6f1d86f24fd;p=jSite2.git use variable for recurring function call --- diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index 9531717..eef499b 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -547,7 +547,8 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh }; List 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) { @@ -555,7 +556,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh } }; - if (I18n.getLocale().getLanguage().equals(locale.getLanguage())) { + if (I18n.getLocale().getLanguage().equals(language)) { languageAction.setEnabled(false); } languageActions.add(languageAction);