Skip to content

Commit

Permalink
Update deepl translation
Browse files Browse the repository at this point in the history
  • Loading branch information
OneMoreGres committed May 19, 2023
1 parent b8cd2df commit 29ee5dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion translators/deepl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ function checkFinished() {

let area = document.querySelector('div#target-dummydiv');
let text = area ? area.innerHTML.trim() : '';
if (area == null) {
area = document.querySelector('d-textarea.lmt__target_textarea p');
text = area ? area.innerText.trim() : '';
}

if (text === lastText || text === '')
return;
Expand Down Expand Up @@ -53,7 +57,8 @@ function translate(text, from, to) {
return;
}
input.innerText = singleLineText;
document.querySelector('div#source-dummydiv').innerHTML = singleLineText;
if (areaCopy = document.querySelector('div#source-dummydiv'))
areaCopy.innerHTML = singleLineText;
setTimeout(function() {
input.dispatchEvent(new Event("input", { bubbles: true, cancelable: true }));
}, 300);
Expand Down
2 changes: 1 addition & 1 deletion updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/bing.js", "path":"$translators$/bing.js", "md5":"a982e9aa6cac598f4c9bf4a56386d13e", "size":1481}
]}
,"deepl": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/deepl.js", "path":"$translators$/deepl.js", "md5":"b05cafaf1c9600bf02dedd699de7df20", "size":2056}
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/deepl.js", "path":"$translators$/deepl.js", "md5":"cda36c52ca2b60f0c237b37a44ecb2b3", "size":2231}
]}
,"google": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google.js", "path":"$translators$/google.js", "md5":"793d6628ac9e26a1f3cc00fa9c863495", "size":1508}
Expand Down

0 comments on commit 29ee5dd

Please sign in to comment.