Don't trigger language change when the language isn't actually changed

This commit is contained in:
RaphiMC 2023-09-17 12:50:43 +02:00
parent 1c18ce4699
commit 75c0434ceb
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -62,6 +62,7 @@ public class UISettingsTab extends AUITab {
language.setSelectedItem(I18n.getCurrentLocale()); language.setSelectedItem(I18n.getCurrentLocale());
language.addActionListener(event -> { language.addActionListener(event -> {
if (!(language.getSelectedItem() instanceof String locale)) return; if (!(language.getSelectedItem() instanceof String locale)) return;
if (locale.equals(I18n.getCurrentLocale())) return;
I18n.setLocale(locale); I18n.setLocale(locale);
ViaProxy.ui.showInfo(I18n.get("tab.ui_settings.language.success", I18n.get("language.name"), locale)); ViaProxy.ui.showInfo(I18n.get("tab.ui_settings.language.success", I18n.get("language.name"), locale));
try { try {