mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 02:52:03 +08:00
更新翻译
This commit is contained in:
@@ -6,6 +6,7 @@ import traceback
|
||||
|
||||
class Trans():
|
||||
isTrans = False
|
||||
unCloudTrans = True
|
||||
word = {}
|
||||
fileName = ""
|
||||
|
||||
@@ -29,6 +30,8 @@ class Trans():
|
||||
try:
|
||||
return self.word[text]
|
||||
except:
|
||||
if self.unCloudTrans:
|
||||
return text
|
||||
# 机翻
|
||||
data = { 'doctype': 'json', 'type': 'auto','i': text}
|
||||
jsonReturn = requests.post("http://fanyi.youdao.com/translate", data=data).json()["translateResult"]
|
||||
|
||||
Reference in New Issue
Block a user