From c4b997db5d1380e2a1681972dcdc39879eee382f Mon Sep 17 00:00:00 2001 From: berbant <33601955+berbant@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:43:54 +0400 Subject: [PATCH] Update LingvaTranslator.js If the text that needs to be translated contains a question mark, then the translation stops at that point. encodeURIComponent fixes this. --- translators/LingvaTranslator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translators/LingvaTranslator.js b/translators/LingvaTranslator.js index 3419f09..bd1f352 100644 --- a/translators/LingvaTranslator.js +++ b/translators/LingvaTranslator.js @@ -9,7 +9,7 @@ class LingvaTranslator { apiPath = 'https://lingva.ml'; translate = (text, from, to) => { - return fetch(`${this.apiPath}/api/v1/${from}/${to}/${text}`, { + return fetch(`${this.apiPath}/api/v1/${from}/${to}/${encodeURIComponent(text)}`, { credentials: 'omit', headers: { 'User-Agent':