Update translators

This commit is contained in:
Gres 2020-04-12 17:01:59 +03:00
parent c63abf4809
commit 962234418b
4 changed files with 18 additions and 23 deletions

View File

@ -21,7 +21,8 @@ for f in it:
print(',"translators":{') print(',"translators":{')
comma = '' comma = ''
for name, file_name in files.items(): for name in sorted(files.keys()):
file_name = files[name]
print(' {}"{}": {{"files":['.format(comma, name)) print(' {}"{}": {{"files":['.format(comma, name))
comma = ',' comma = ','
md5 = hashlib.md5() md5 = hashlib.md5()

View File

@ -55,7 +55,7 @@ function translate(text, from, to) {
} }
let url = 'https://papago.naver.com/?sk=auto&tk=' + to + '&st=' + encodeURIComponent(text); let url = 'https://papago.naver.com/?sk=auto&tk=' + to + '&st=' + encodeURIComponent(text);
window.location = encodeURI(url); window.location = url;
} }
function init() { function init() {

View File

@ -23,15 +23,6 @@ function translate(text, from, to) {
active = true; active = true;
let langs = 'lang=' + from + '-' + to; let langs = 'lang=' + from + '-' + to;
if (window.location.href.indexOf('//translate.yandex') !== -1
&& window.location.href.indexOf(langs) !== -1) {
document.querySelector('div#fakeArea').value = text;
document.querySelector('textarea#textarea').value = text;
document.querySelector('div#textbox').dispatchEvent(
new Event("input", { bubbles: true, cancelable: true }));
return;
}
let url = 'https://translate.yandex.ru/?' + langs + '&text=' + encodeURIComponent(text); let url = 'https://translate.yandex.ru/?' + langs + '&text=' + encodeURIComponent(text);
console.log("setting url", url); console.log("setting url", url);
window.location = url; window.location = url;

View File

@ -573,23 +573,26 @@
,"translators":{ ,"translators":{
"bing": {"files":[ "baidu": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/bing.js", "path":"$translators$/bing.js", "md5":"fc69c1e05a3462a88131ee0a8422ad89"} {"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/baidu.js", "path":"$translators$/baidu.js", "md5":"93f7bca9b792877350f54a1d47767583", "size":1306}
]} ]}
,"google": {"files":[ ,"bing": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google.js", "path":"$translators$/google.js", "md5":"58128258211838ac23c84d18edc9c268"} {"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/bing.js", "path":"$translators$/bing.js", "md5":"5c20fe78c25a4f9e97160fdc3bc4572c", "size":1277}
]}
,"google_api": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google_api.js", "path":"$translators$/google_api.js", "md5":"087dfe395c6ee803bf0e69693a27a41a"}
]}
,"yandex": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/yandex.js", "path":"$translators$/yandex.js", "md5":"931306b7cf54c529638a730ad2ada0ef"}
]} ]}
,"deepl": {"files":[ ,"deepl": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/deepl.js", "path":"$translators$/deepl.js", "md5":"eb333c2e210dc955d523e68339e68b84"} {"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/deepl.js", "path":"$translators$/deepl.js", "md5":"a6dfae3f63ca3fa9c7edbfaff87600e4", "size":1596}
]}
,"google": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google.js", "path":"$translators$/google.js", "md5":"16ffead93035e08e8db13279cc8b65a7", "size":1260}
]}
,"google_api": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/google_api.js", "path":"$translators$/google_api.js", "md5":"ba0d5fb0e156cccd47e048389c2762fa", "size":865}
]} ]}
,"papago": {"files":[ ,"papago": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/papago.js", "path":"$translators$/papago.js", "md5":"27d8031bcab27cf2f14c815c60785f0b"} {"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/papago.js", "path":"$translators$/papago.js", "md5":"538bb7280192b18d15d24b07adae2638", "size":1956}
]}
,"yandex": {"files":[
{"url":"https://raw.githubusercontent.com/OneMoreGres/ScreenTranslator/master/translators/yandex.js", "path":"$translators$/yandex.js", "md5":"f8c625e8f6ced4a9f5be6791a6ee3f87", "size":957}
]} ]}
} }
} }