Fix applying language without restart

This commit is contained in:
Eric Kotato 2019-12-25 14:46:33 +03:00
parent fdb4fa4254
commit 2dc0071b29

View file

@ -436,6 +436,8 @@ void CloudManager::sendSwitchingToLanguageRequest() {
const auto finalize = [=] {
if (canApplyWithoutRestart(language.id)) {
performSwitchAndAddToRecent(language);
Lang::Current().fillDefaultJson();
Lang::Current().fillFromJson();
} else {
performSwitchAndRestart(language);
}
@ -471,6 +473,8 @@ void CloudManager::switchToLanguage(const Language &data) {
performSwitchToCustom();
} else if (canApplyWithoutRestart(data.id)) {
performSwitchAndAddToRecent(data);
Lang::Current().fillDefaultJson();
Lang::Current().fillFromJson();
} else {
QVector<MTPstring> keys;
keys.reserve(3);
@ -524,6 +528,8 @@ void CloudManager::performSwitchToCustom() {
}
if (canApplyWithoutRestart(qsl("#custom"))) {
_langpack.switchToCustomFile(filePath);
Lang::Current().fillDefaultJson();
Lang::Current().fillFromJson();
} else {
const auto values = loader.found();
const auto getValue = [&](ushort key) {