[Client] Restore language switching in SettingsView

Deleting DlgSettings removed its updateLanguage hook, the only
langChanged handler that swapped the QTranslator. SettingsView takes
it over so picking a language applies immediately.
This commit is contained in:
Lukas Brübach 2026-10-11 14:58:01 +02:00
parent ecb77e631e
commit 41f01ff4a9

View file

@ -92,9 +92,9 @@ static QStringList pageIconResources()
SettingsView::SettingsView(QWidget *parent) : QWidget(parent), currentTabIndex(0), searchActive(false) SettingsView::SettingsView(QWidget *parent) : QWidget(parent), currentTabIndex(0), searchActive(false)
{ {
// Swap the QTranslator before retranslating (was DlgSettings::updateLanguage): without this, picking a new // Swap the QTranslator before retranslating (was DlgSettings::updateLanguage, removed with the dialog):
// language only stores the setting and every retranslateUi re-runs against the old translator until restart. // without this, picking a new language only stores the setting and every retranslateUi re-runs against the
// Connected before setupUi() so the swap runs before the pages' own langChanged handlers below. // old translator until restart. Connected before setupUi() so the swap runs before the pages' own handlers.
connect(&SettingsCache::instance().personal(), &PersonalSettings::langChanged, this, &SettingsView::updateLanguage); connect(&SettingsCache::instance().personal(), &PersonalSettings::langChanged, this, &SettingsView::updateLanguage);
setupUi(); setupUi();