Skip to content

Commit

Permalink
修复:谷歌翻译 代理没配置的情况下,变量未定义问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Aug 20, 2024
1 parent b83f462 commit 4bae9a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/my_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def google_trans(self, text):
try:
if self.config_data['google']['proxy'] != "":
proxies = {'https': self.config_data['google']['proxy']}
else:
proxies = None

client = Translate(proxies=proxies)

Expand Down

0 comments on commit 4bae9a7

Please sign in to comment.