mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added ability to use platform provider of translations on macOS.
This commit is contained in:
@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "lang/translate_provider.h"
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/core_settings.h"
|
||||
#include "data/data_msg_id.h"
|
||||
#include "data/data_peer.h"
|
||||
#include "data/data_session.h"
|
||||
@@ -18,6 +20,10 @@ namespace Ui {
|
||||
|
||||
std::unique_ptr<TranslateProvider> CreateTranslateProvider(
|
||||
not_null<Main::Session*> session) {
|
||||
if (Core::App().settings().usePlatformTranslation()
|
||||
&& Platform::IsTranslateProviderAvailable()) {
|
||||
return Platform::CreateTranslateProvider();
|
||||
}
|
||||
return CreateMTProtoTranslateProvider(session);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user