2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Remove LangKey.

This commit is contained in:
John Preston
2019-06-19 17:42:16 +02:00
parent 87fc066e67
commit edcd09c29f
16 changed files with 97 additions and 100 deletions

View File

@@ -149,17 +149,19 @@ void Widget::createLanguageLink() {
const auto defaultId = Lang::DefaultLanguageId();
const auto suggested = Lang::CurrentCloudManager().suggestedLanguage();
if (currentId != defaultId) {
createLink(Lang::GetOriginalValue(lng_switch_to_this), defaultId);
createLink(
Lang::GetOriginalValue(tr::lng_switch_to_this.base),
defaultId);
} else if (!suggested.isEmpty() && suggested != currentId) {
request(MTPlangpack_GetStrings(
MTP_string(Lang::CloudLangPackName()),
MTP_string(suggested),
MTP_vector<MTPstring>(1, MTP_string("lng_switch_to_this"))
)).done([=](const MTPVector<MTPLangPackString> &result) {
auto strings = Lang::Instance::ParseStrings(result);
auto it = strings.find(lng_switch_to_this);
if (it != strings.end()) {
createLink(it->second, suggested);
const auto strings = Lang::Instance::ParseStrings(result);
const auto i = strings.find(tr::lng_switch_to_this.base);
if (i != strings.end()) {
createLink(i->second, suggested);
}
}).send();
}