From 683c0a345b1a9926ab4e682c7b193f912633dac3 Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 15 Mar 2017 19:06:56 -0700 Subject: [PATCH] When the user saves the locale, save it to the prefs. Oops. --- src/core/i18n/Locale.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; }