From d86704cc27598d7dee9fa6a08fd220d68d6eba52 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Wed, 4 Mar 2020 11:38:19 +0100 Subject: [PATCH] Update GoogleTranslateOption.plugin.js --- .../GoogleTranslateOption/GoogleTranslateOption.plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index 6da335e4c3..1776749227 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -27,7 +27,7 @@ var GoogleTranslateOption = (_ => { return class GoogleTranslateOption { getName () {return "GoogleTranslateOption";} - getVersion () {return "1.9.5";} + getVersion () {return "1.9.6";} getAuthor () {return "DevilBro";} @@ -36,7 +36,7 @@ var GoogleTranslateOption = (_ => { constructor () { this.changelog = { "added":[["GoogleApi","Added a new way faster Google Api that uses a translation API provided by Google, which does not rely on using an invisible brower window to translate the text, this API is limited to 100 requests per hour, so you might get rate limited quickly"]], - "improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]] + "fixed":[["GoogleApi","Fixed issue where GoogleApi would cut off sentences"]] }; this.patchedModules = { @@ -626,7 +626,7 @@ var GoogleTranslateOption = (_ => { data.input.name = languages[result.src].name; data.input.ownlang = languages[result.src].ownlang; } - callback(result.sentences[0].trans); + callback(result.sentences.map(n => n && n.trans).filter(n => n).join("")); } catch (err) {callback("");} }