mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-28 19:40:54 +00:00
Fix building without spellcheck
Port from gentoo: f62d7c6599/net-im/telegram-desktop/files/tdesktop-4.3.4-fix-disabling-spellcheck.patch
/var/tmp/portage/net-im/telegram-desktop-4.3.4/work/tdesktop-4.3.4-full/Telegram/SourceFiles/boxes/translate_box.cpp:18:10: fatal error: spellcheck/platform/platform_language.h: No such file or directory
18 | #include "spellcheck/platform/platform_language.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
This commit is contained in:
parent
e4d8a06cf9
commit
d01969ff1e
@ -15,7 +15,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "main/main_session.h"
|
||||
#include "mtproto/sender.h"
|
||||
#include "settings/settings_common.h"
|
||||
#ifndef TDESKTOP_DISABLE_SPELLCHECK
|
||||
#include "spellcheck/platform/platform_language.h"
|
||||
#endif
|
||||
#include "ui/effects/loading_element.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
@ -343,6 +345,7 @@ bool SkipTranslate(TextWithEntities textWithEntities) {
|
||||
if (!hasLetters) {
|
||||
return true;
|
||||
}
|
||||
#ifndef TDESKTOP_DISABLE_SPELLCHECK
|
||||
const auto result = Platform::Language::Recognize(text);
|
||||
if (result.unknown) {
|
||||
return false;
|
||||
@ -355,6 +358,9 @@ bool SkipTranslate(TextWithEntities textWithEntities) {
|
||||
? QLocale::English
|
||||
: settingsLang;
|
||||
return (result.locale.language() == skip);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
|
Loading…
Reference in New Issue
Block a user