Debug print translated message.

Sometimes prevent duplicate translations.
This commit is contained in:
Gres 2017-08-30 19:28:17 +03:00
parent ce8567afca
commit fe16cbe669
4 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,7 @@ function checkFinished () {
var text = spans.reduce (function (res, i) { var text = spans.reduce (function (res, i) {
return res + i.innerText; return res + i.innerText;
}, ''); }, '');
console.log (text);
st_wtp.translated (text); st_wtp.translated (text);
isTranslationFinished = isScheduled = false; isTranslationFinished = isScheduled = false;
}, 2000); // wait for gui fill }, 2000); // wait for gui fill

View File

@ -10,6 +10,7 @@ function checkFinished () {
var text = spans.reduce (function (res, i) { var text = spans.reduce (function (res, i) {
return res + ' ' + i.innerText; return res + ' ' + i.innerText;
}, ''); }, '');
console.log (text);
st_wtp.translated (text); st_wtp.translated (text);
isTranslationFinished = isScheduled = false; isTranslationFinished = isScheduled = false;
}, 2000); // wait for gui fill }, 2000); // wait for gui fill

View File

@ -10,6 +10,7 @@ function checkFinished () {
var text = spans.reduce (function (res, i) { var text = spans.reduce (function (res, i) {
return res + i.innerText + ' '; return res + i.innerText + ' ';
}, ''); }, '');
console.log (text);
st_wtp.translated (text); st_wtp.translated (text);
isTranslationFinished = isScheduled = false; isTranslationFinished = isScheduled = false;
}, 2000); // wait for gui fill }, 2000); // wait for gui fill

View File

@ -13,17 +13,17 @@
"path_linux": "ScreenTranslator" "path_linux": "ScreenTranslator"
}, },
"Bing translator": { "Bing translator": {
"version": 2, "version": 3,
"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"
}, },
"Google translator": { "Google translator": {
"version": 2, "version": 3,
"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"
}, },
"Yandex translator": { "Yandex translator": {
"version": 3, "version": 4,
"url": "https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/yandex.js", "url": "https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/yandex.js",
"path": "translators/yandex.js" "path": "translators/yandex.js"
} }