From 306b9f0525b737ca730da4b98a22f0f238474424 Mon Sep 17 00:00:00 2001 From: Blu3train Date: Sun, 28 Nov 2021 11:23:18 +0100 Subject: [PATCH] Don't translate text consisting of spaces only --- extensions/translatewrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/translatewrapper.cpp b/extensions/translatewrapper.cpp index f74fad7..17b999d 100644 --- a/extensions/translatewrapper.cpp +++ b/extensions/translatewrapper.cpp @@ -153,7 +153,7 @@ private: bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) { - if (sentenceInfo["text number"] == 0 || sentence.size() > maxSentenceSize) return false; + if (sentenceInfo["text number"] == 0 || sentence.size() > maxSentenceSize || !std::regex_replace(sentence, std::wregex(L"\\s|\u200B"), L"").length()) return false; static class {