2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Move lang keys to td_lang library.

This commit is contained in:
John Preston
2020-09-30 12:11:44 +03:00
parent def1266216
commit 8634c1f7f3
41 changed files with 271 additions and 164 deletions

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "intro/intro_signup.h"
#include "intro/intro_password_check.h"
#include "lang/lang_keys.h"
#include "lang/lang_instance.h"
#include "lang/lang_cloud_manager.h"
#include "storage/localstorage.h"
#include "main/main_account.h"
@@ -126,7 +127,10 @@ Widget::Widget(
_changeLanguage->finishAnimating();
}
subscribe(Lang::Current().updated(), [this] { refreshLang(); });
Lang::Updated(
) | rpl::start_with_next([=] {
refreshLang();
}, lifetime());
show();
showControls();
@@ -241,7 +245,7 @@ void Widget::createLanguageLink() {
updateControlsGeometry();
};
const auto currentId = Lang::LanguageIdOrDefault(Lang::Current().id());
const auto currentId = Lang::LanguageIdOrDefault(Lang::Id());
const auto defaultId = Lang::DefaultLanguageId();
const auto suggested = Lang::CurrentCloudManager().suggestedLanguage();
if (currentId != defaultId) {