Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions faster_whisper_GUI/settingPageNavigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def setupUI(self):

# --------------------------------------------------------------------------------------------------------------------------------------------------------------
self.combox_language = ComboBox()
self.combox_language.addItems(["中文","English",self.__tr("自动")])
self.combox_language.setCurrentIndex(2)
self.combox_language.addItems(["中文","English","한국어",self.__tr("自动")])
self.combox_language.setCurrentIndex(3)
self.paramItemWidget_language = ParamWidget(self.__tr("语言"), self.__tr("程序界面语言,修改后重启生效"),self.combox_language, self)
self.addWidget(self.paramItemWidget_language)

Expand Down
13 changes: 11 additions & 2 deletions faster_whisper_GUI/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
config_json = json.load(open("./fasterWhisperGUIConfig.json", "r", encoding="utf-8"))
language_config = config_json["setting"]["language"]
except:
language_config = 2
language_config = 3

if language_config == 0:
language = "zh"
elif language_config == 1:
language = "en"
elif language_config == 2:
language = "ko"
else:
# 获取当前计算机语言
language_localtion, _ = locale.getdefaultlocale()
Expand All @@ -26,7 +28,14 @@

def __translator() -> QTranslator:
translator = QTranslator()
if language != "zh" :
if language == "ko":
try:
translator.load(":/resource/Translater/ko.qm")
# splash.showMessage("set Language: Korean") #, Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignHCenter, Qt.white)
except Exception as e:
print(f"load translator files error: {str(e)}")
translator.load("")
elif language != "zh":
try:
translator.load(":/resource/Translater/en.qm")
# splash.showMessage("set Language: English") #, Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignHCenter, Qt.white)
Expand Down
1 change: 1 addition & 0 deletions resource/_rc/Translater.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/resource">
<file>Translater/en.qm</file>
<file>Translater/ko.qm</file>
</qresource>
</RCC>
Binary file added resource/_rc/Translater/ko.qm
Binary file not shown.
Loading