Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error #9

Open
TheMandalorianHub opened this issue Aug 25, 2022 · 0 comments
Open

error #9

TheMandalorianHub opened this issue Aug 25, 2022 · 0 comments

Comments

@TheMandalorianHub
Copy link

original: (optional)]]>
使用有道备用翻译通道2
使用接口,仅支持中英互译,将翻译为英文
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translate_youdao.py", line 48, in trans1
if(resp.json()['translation']):
KeyError: 'translation'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translate_youdao.py", line 76, in trans2
return resp.json()['translateResult'][0][0]['tgt']
KeyError: 'translateResult'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/bin/translate", line 33, in
main()
File "/opt/homebrew/bin/translate", line 29, in main
mkTranslator().translate_doc(filepath=args.file_path, destination=args.dest_language,sourcelanguage=args.sourcelanguage,channel=args.channel)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translator.py", line 168, in translate_doc
self.write_tx(filepath,newFile,r">\s*(.+?)\s*",'>'+'content'+'',destination,sourcelanguage,channel)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translator.py", line 101, in write_tx
txc = self.translate(line[0],des,lan,channel)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translator.py", line 75, in translate
return mkYouDaoTranslator().translate(word,destination,language)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translate_youdao.py", line 37, in translate
return self.trans1(text,dest,src)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translate_youdao.py", line 52, in trans1
return self.trans2(text,dest,src)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translate_youdao.py", line 78, in trans2
return self.trans3(text,dest,src)
File "/opt/homebrew/lib/python3.9/site-packages/mkTranslation/translate_youdao.py", line 94, in trans3
return self.result['translation'][0]
KeyError: 'translation'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant