Migrate setting about Simplified Chinese locale

Related to PR #17978
This commit is contained in:
sledgehammer999
2023-01-22 02:31:58 +02:00
parent d20633f9cc
commit cc7f8372a8

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;
}