From 4e4cf008841ef47bec10245a4b6fd154d6c589a0 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Thu, 20 Dec 2018 11:02:03 -0500 Subject: [PATCH] fix error log --- extensions/googletranslate.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/googletranslate.cpp b/extensions/googletranslate.cpp index acf41fc..b755c3a 100644 --- a/extensions/googletranslate.cpp +++ b/extensions/googletranslate.cpp @@ -196,7 +196,11 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) translation += std::wstring(results[1]) + L" "; for (auto& c : translation) if (c == L'\\') c = 0x200b; } - else TKK = 0; + else + { + translation = TRANSLATION_ERROR + (L" (TKK=" + std::to_wstring(TKK) + L")"); + TKK = 0; + } } WinHttpCloseHandle(request); } @@ -204,7 +208,7 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) } } - if (translation.empty()) translation = TRANSLATION_ERROR + (L" (TKK=" + std::to_wstring(TKK) + L")"); + if (translation.empty()) translation = TRANSLATION_ERROR; sentence += L"\r\n" + translation; return true; }