From 2dc0071b291f82fc122fcd198e337ec8f9639eb4 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Wed, 25 Dec 2019 14:46:33 +0300 Subject: [PATCH] Fix applying language without restart --- Telegram/SourceFiles/lang/lang_cloud_manager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/lang/lang_cloud_manager.cpp b/Telegram/SourceFiles/lang/lang_cloud_manager.cpp index 3a0b789c3..206b4ddb0 100644 --- a/Telegram/SourceFiles/lang/lang_cloud_manager.cpp +++ b/Telegram/SourceFiles/lang/lang_cloud_manager.cpp @@ -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 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) {