Updated bing translator

This commit is contained in:
Gres 2019-08-11 21:37:00 +03:00
parent 0b3396e1f4
commit d44c8ef060
2 changed files with 2 additions and 5 deletions

View File

@ -6,10 +6,7 @@ function checkFinished () {
if (!isPageLoaded || !isTranslationFinished || isScheduled) return; if (!isPageLoaded || !isTranslationFinished || isScheduled) return;
isScheduled = true; isScheduled = true;
setTimeout(function () { setTimeout(function () {
var spans = [].slice.call (document.querySelectorAll ('#t_txtoutblk textarea')); var text = document.querySelector ('#tta_output').value;
var text = spans.reduce (function (res, i) {
return res + i.value;
}, '');
console.log (text); console.log (text);
st_wtp.translated (text); st_wtp.translated (text);
isTranslationFinished = isScheduled = false; isTranslationFinished = isScheduled = false;

View File

@ -13,7 +13,7 @@
"path_linux": "ScreenTranslator" "path_linux": "ScreenTranslator"
}, },
"Bing translator": { "Bing translator": {
"version": 4, "version": 5,
"url": "https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/bing.js", "url": "https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/bing.js",
"path": "translators/bing.js" "path": "translators/bing.js"
}, },