Update GoogleTranslateOption.plugin.js

This commit is contained in:
Mirco Wittrien 2019-12-09 20:32:05 +01:00
parent 5ee65921cb
commit fa1438ea33
1 changed files with 14 additions and 2 deletions

View File

@ -3,7 +3,7 @@
class GoogleTranslateOption {
getName () {return "GoogleTranslateOption";}
getVersion () {return "1.8.1";}
getVersion () {return "1.8.2";}
getAuthor () {return "DevilBro";}
@ -237,7 +237,7 @@ class GoogleTranslateOption {
if (this.translating) {
BDFDB.ReactUtils.forceUpdate(e.instance);
this.translateText(e2.methodArguments[0], "message", (translation, input, output) => {
translation = !translation ? text : (BDFDB.DataUtils.get(this, "settings", "sendOriginalMessage") ? text + "\n\n" + translation : translation);
translation = !translation ? e2.methodArguments[0] : (BDFDB.DataUtils.get(this, "settings", "sendOriginalMessage") ? e2.methodArguments[0] + "\n\n" + translation : translation);
e2.originalMethod(translation);
});
}
@ -405,6 +405,7 @@ class GoogleTranslateOption {
searchable: true,
onChange: engine => {
BDFDB.DataUtils.save(engine.value, this, "engines", key);
this.setLanguages();
}
})
}));
@ -538,6 +539,17 @@ class GoogleTranslateOption {
callback(messagedata[0]);
});
}
iTranslateTranslate (data, callback) {
console.log(data)
BDFDB.LibraryRequires.request("https://www.itranslate.com/themes/itranslate2016/assets/webapp/js/main.js", (error, response, result) => {
console.log(error, response, result);
if (!error && result) {
callback("");
}
else callback("");
});
}
checkForSpecialCase (text, input) {
if (input.id == "binary" || input.id == "braille" || input.id == "morse") return input;