From 42e4973721cc0dd3e585b7dbdde45522fbf337be Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 31 Jan 2020 23:24:49 -0700 Subject: [PATCH] bing api changed --- extensions/bingtranslate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/bingtranslate.cpp b/extensions/bingtranslate.cpp index 321bbac..8f57f02 100644 --- a/extensions/bingtranslate.cpp +++ b/extensions/bingtranslate.cpp @@ -64,8 +64,8 @@ std::pair Translate(const std::wstring& text) L"POST", FormatString(L"/ttranslatev3?fromLang=auto-detect&to=%s&text=%s", translateTo->c_str(), Escape(text)).c_str() }) - // Response formatted as JSON: translation starts with text":" and ends with "," - if (std::wsmatch results; std::regex_search(httpRequest.response, results, std::wregex(L"text\":\"(.+)\"\\,"))) return { true, results[1] }; + // Response formatted as JSON: translation starts with text":" and ends with ","to + if (std::wsmatch results; std::regex_search(httpRequest.response, results, std::wregex(L"text\":\"(.+)\"\\,\"to"))) return { true, results[1] }; else return { false, TRANSLATION_ERROR }; else return { false, FormatString(L"%s (code=%u)", TRANSLATION_ERROR, httpRequest.errorCode) }; }