From e530db1c8890cb1eb3acda532cfee6f1d86f24fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 28 May 2008 13:56:30 +0200 Subject: [PATCH] use variable for recurring function call --- src/net/pterodactylus/jsite/gui/SwingInterface.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.7.4