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:
mid-kid 2022-12-06 23:45:14 +01:00 committed by John Preston
parent e4d8a06cf9
commit d01969ff1e
1 changed files with 6 additions and 0 deletions

View File

@ -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