Migrate setting about Simplified Chinese locale

Related to PR #17978
This commit is contained in:
sledgehammer999 2023-01-22 02:31:58 +02:00
commit cc7f8372a8
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -384,6 +384,18 @@ namespace
}
}
#endif
void migrateChineseLocale()
{
auto *settingsStorage = SettingsStorage::instance();
const auto key = u"Preferences/General/Locale"_qs;
if (settingsStorage->hasKey(key))
{
const auto locale = settingsStorage->loadValue<QString>(key);
if (locale.compare(u"zh"_qs, Qt::CaseInsensitive) == 0)
settingsStorage->storeValue(key, u"zh_CN"_qs);
}
}
}
bool upgrade(const bool /*ask*/)
@ -413,6 +425,9 @@ bool upgrade(const bool /*ask*/)
migrateMemoryPrioritySettings();
#endif
{
migrateChineseLocale();
}
version = MIGRATION_VERSION;
}