Updated google translation

This commit is contained in:
Gres 2018-11-29 19:22:51 +03:00
parent a69213c956
commit 49c5659334
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,8 @@ 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 ('#result_box > span')); var spans = [].slice.call (document.querySelectorAll (
'span.translation > span, #result_box > span'));
var text = spans.reduce (function (res, i) { var text = spans.reduce (function (res, i) {
return res + ' ' + i.innerText; return res + ' ' + i.innerText;
}, ''); }, '');

View File

@ -18,7 +18,7 @@
"path": "translators/bing.js" "path": "translators/bing.js"
}, },
"Google translator": { "Google translator": {
"version": 3, "version": 4,
"url": "https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google.js", "url": "https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google.js",
"path": "translators/google.js" "path": "translators/google.js"
}, },