Skip to content

Commit

Permalink
<fix> fix google free translation error without config
Browse files Browse the repository at this point in the history
update version to v1.4.5
  • Loading branch information
anonymousException committed Feb 17, 2024
1 parent 55a4027 commit 857db6a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ def __init__(self, parent=None):
self.extractBtn.clicked.connect(self.extract)
self.replaceFontBtn.clicked.connect(self.replaceFont)
self.openFontStyleBtn.clicked.connect(self.openFontStyleFile)
self.init_combobox()
try:
self.init_combobox()
except Exception as e:
msg = traceback.format_exc()
log_print(msg)
self.versionLabel.setStyleSheet("color:grey")
self.copyrightLabel.setStyleSheet("color:grey")
self.actioncopyright.triggered.connect(lambda: self.show_copyright_form())
Expand Down
7 changes: 6 additions & 1 deletion src/renpy_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,16 @@ def TranslateFile(p, lang_target, lang_source):
elif loaded_data['engine'] == engineList[1]:
client = ApiKeyTranslate(fmt = 'text',proxies=proxies,api_key=loaded_data['key'])
elif loaded_data['engine'] == engineList[2]:
client=YoudaoTranslate(app_key=loaded_data['key'],app_secret=loaded_data['secret'],proxies=proxies)
client = YoudaoTranslate(app_key=loaded_data['key'],app_secret=loaded_data['secret'],proxies=proxies)
elif loaded_data['engine'] == engineList[3]:
client = DeeplTranslate(app_key=loaded_data['key'], proxies=proxies)
else:
log_print('engine.txt' + ' file format error!')
msg = traceback.format_exc()
log_print(msg)
return
else:
client = Translate(fmt='text', proxies=proxies)
transList = []
try:
f = io.open(p, 'r+', encoding='utf-8')
Expand Down
2 changes: 1 addition & 1 deletion src/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def retranslateUi(self, MainWindow):
self.extractBtn.setText(QCoreApplication.translate("MainWindow", u"extract", None))
self.label_8.setText(QCoreApplication.translate("MainWindow", u"tl name", None))
self.tlNameText.setPlaceholderText(QCoreApplication.translate("MainWindow", u"only needs in file(s) mode,if you input the directory , just fill nothing. input the directory name under game\\tl Example: japanese or chinese or german", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 1.4.4", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 1.4.5", None))
self.copyrightLabel.setText(QCoreApplication.translate("MainWindow", u"\u00a92024 Last moment,All rights reserved.", None))
self.label_11.setText(QCoreApplication.translate("MainWindow", u"font", None))
self.selectFontText.setPlaceholderText(QCoreApplication.translate("MainWindow", u"input or choose or drag the font which supports the language after translation. Example : DejaVuSans.ttf (ren'py 's default font)", None))
Expand Down
2 changes: 1 addition & 1 deletion src/ui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
</rect>
</property>
<property name="text">
<string>Version 1.4.4</string>
<string>Version 1.4.5</string>
</property>
</widget>
<widget class="QLabel" name="copyrightLabel">
Expand Down

0 comments on commit 857db6a

Please sign in to comment.