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.addActionListener(event -> {
if (!(language.getSelectedItem() instanceof String locale)) return;
if (locale.equals(I18n.getCurrentLocale())) return;
I18n.setLocale(locale);
ViaProxy.ui.showInfo(I18n.get("tab.ui_settings.language.success", I18n.get("language.name"), locale));
try {