2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Use Qt UI language if system was not determined.

Also rename platform/mac/specific_mac.cpp to .mm
This commit is contained in:
John Preston
2017-05-30 12:31:32 +03:00
parent 6fb980ca79
commit f5353080e7
13 changed files with 119 additions and 49 deletions

View File

@@ -29,6 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mtproto/sender.h"
#include "mtproto/rsa_public_key.h"
#include "lang/lang_instance.h"
#include "lang/lang_cloud_manager.h"
#include "base/timer.h"
namespace MTP {
@@ -600,6 +601,7 @@ void Instance::Private::configLoadDone(const MTPConfig &result) {
Global::SetPhoneCallsEnabled(data.is_phonecalls_enabled());
Global::RefPhoneCallsEnabledChanged().notify();
}
Lang::CurrentCloudManager().setSuggestedLanguage(data.has_suggested_lang_code() ? qs(data.vsuggested_lang_code) : QString());
Local::writeSettings();
@@ -1082,6 +1084,8 @@ bool Instance::Private::onErrorDefault(mtpRequestId requestId, const RPCError &e
session->sendPrepared(request);
}
return true;
} else if (err == qstr("CONNECTION_LANG_CODE_INVALID")) {
Lang::CurrentCloudManager().switchToLanguage(qsl("en"));
} else if (err == qstr("MSG_WAIT_FAILED")) {
mtpRequest request;
{
@@ -1270,6 +1274,10 @@ DcId Instance::mainDcId() const {
return _private->mainDcId();
}
QString Instance::systemLangCode() const {
return Lang::Current().systemLangCode();
}
QString Instance::cloudLangCode() const {
return Lang::Current().cloudLangCode();
}