Allow multiline query in Lingva engine

This commit is contained in:
1F616EMO 2024-12-31 10:40:54 +08:00
parent d304551ee0
commit b4b9ccdde8
No known key found for this signature in database
GPG Key ID: EF52EFA8E05859B2

View File

@ -130,10 +130,10 @@ local function translate(source, target, query, callback)
return callback(false, S("Engine not yet initialized."))
end
query = string.gsub(query, "\"", "\\\"")
-- query = string.gsub(query, "\"", "\\\"")
graphql_fetch(
"{translation(source: \"" .. source .. "\", target: \"" .. target ..
"\", query: \"" .. query .. "\"){source{detected{code}},target{text}}}",
"\", query: \"\"\"" .. query .. "\"\"\"){source{detected{code}},target{text}}}",
function(data)
if data then
return callback(