diff --git a/src/controller/main_controller.py b/src/controller/main_controller.py index cb78b85..5ec2b5a 100644 --- a/src/controller/main_controller.py +++ b/src/controller/main_controller.py @@ -90,7 +90,8 @@ def generate_transcription(self, source: str, language_name: str): if not self._is_file_valid(source): self.view.display_text( _( - "Error: No audio file selected, please select one before generating text." + "Error: No audio file selected, please select one before " + "generating text." ) ) else: diff --git a/src/utils/constants.py b/src/utils/constants.py index c1f414e..2ad26e2 100644 --- a/src/utils/constants.py +++ b/src/utils/constants.py @@ -134,7 +134,7 @@ "ur_IN": "(اردو (بھارت", "ur_PK": "(اردو (پاکستان", "vi": "Tiếng Việt", - "zh_CN": "中文(中国)", + "zh": "中文(中国)", "zh_HK": "中文(香港)", "zh_TW": "中文(台灣)", "zu": "Isizulu", diff --git a/src/utils/i18n.py b/src/utils/i18n.py index c0a924a..2527d25 100644 --- a/src/utils/i18n.py +++ b/src/utils/i18n.py @@ -40,4 +40,4 @@ def load_translation(language_code: str): _ = translation.gettext -load_translation(locale.getdefaultlocale()[0]) +load_translation(locale.getdefaultlocale()[0][:2]) diff --git a/src/view/main_window.py b/src/view/main_window.py index 2005ad5..44be86f 100644 --- a/src/view/main_window.py +++ b/src/view/main_window.py @@ -55,7 +55,7 @@ def _init_sidebar(self): self.frm_sidebar, values=list(c.AUDIO_LANGUAGES.values()) ) self.cbx_audio_language.grid(row=2, column=0, padx=20, pady=10) - self.cbx_audio_language.set(c.AUDIO_LANGUAGES[locale.getdefaultlocale()[0]]) + self.cbx_audio_language.set(c.AUDIO_LANGUAGES[locale.getdefaultlocale()[0][:2]]) # Select file button self.btn_select_file = ctk.CTkButton( @@ -94,7 +94,7 @@ def _init_sidebar(self): ) self.omn_app_language.grid(row=8, column=0, padx=20, pady=10) self.omn_app_language.set( - c.APP_LANGUAGES.get(locale.getdefaultlocale()[0].split("_")[0], "English") + c.APP_LANGUAGES.get(locale.getdefaultlocale()[0][:2], "English") ) # Appearance mode