diff --git a/src/core/i18n/Locale.cpp b/src/core/i18n/Locale.cpp index 7edf7e51a..79bf3e706 100644 --- a/src/core/i18n/Locale.cpp +++ b/src/core/i18n/Locale.cpp @@ -120,13 +120,16 @@ bool Locale::SetSelectedLocale(const std::string& locale) { }); if (it != this->locales.end()) { - this->selectedLocale = locale; - this->localeData = nlohmann::json({}); - std::string localeFn = this->localePath + "/" + locale + ".json"; this->localeData = loadLocaleData(localeFn); if (!this->localeData.is_null()) { + this->selectedLocale = locale; + this->localeData = nlohmann::json({}); + + prefs->SetString(keys::Locale, this->selectedLocale.c_str()); + prefs->Save(); + this->LocaleChanged(this->selectedLocale); return true; }