bing api update
This commit is contained in:
parent
44c8e4f94c
commit
ad3f09d8ef
@ -233,7 +233,7 @@ std::pair<bool, std::wstring> Translate(const std::wstring& text, TranslationPar
|
|||||||
L"Mozilla/5.0 Textractor",
|
L"Mozilla/5.0 Textractor",
|
||||||
L"www.bing.com",
|
L"www.bing.com",
|
||||||
L"POST",
|
L"POST",
|
||||||
FormatString(L"/ttranslatev3?fromLang=%s&to=%s&text=%s%s%d", codes.at(tlp.translateFrom), codes.at(tlp.translateTo), Escape(text), token.Copy(), i++).c_str()
|
FormatString(L"/ttranslatev3?fromLang=%s&to=%s&text=%s%s.%d", codes.at(tlp.translateFrom), codes.at(tlp.translateTo), Escape(text), token.Copy(), i++).c_str()
|
||||||
})
|
})
|
||||||
if (auto translation = Copy(JSON::Parse(httpRequest.response)[0][L"translations"][0][L"text"].String())) return { true, translation.value() };
|
if (auto translation = Copy(JSON::Parse(httpRequest.response)[0][L"translations"][0][L"text"].String())) return { true, translation.value() };
|
||||||
else return { false, FormatString(L"%s (token=%s): %s", TRANSLATION_ERROR, std::exchange(token.Acquire().contents, L""), httpRequest.response) };
|
else return { false, FormatString(L"%s (token=%s): %s", TRANSLATION_ERROR, std::exchange(token.Acquire().contents, L""), httpRequest.response) };
|
||||||
|
Loading…
Reference in New Issue
Block a user