When the user saves the locale, save it to the prefs. Oops.

This commit is contained in:
casey langen 2017-03-15 19:06:56 -07:00
parent cfbd8baa3a
commit 683c0a345b

View File

@ -120,13 +120,16 @@ bool Locale::SetSelectedLocale(const std::string& locale) {
}); });
if (it != this->locales.end()) { if (it != this->locales.end()) {
this->selectedLocale = locale;
this->localeData = nlohmann::json({});
std::string localeFn = this->localePath + "/" + locale + ".json"; std::string localeFn = this->localePath + "/" + locale + ".json";
this->localeData = loadLocaleData(localeFn); this->localeData = loadLocaleData(localeFn);
if (!this->localeData.is_null()) { 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); this->LocaleChanged(this->selectedLocale);
return true; return true;
} }