Skip to content

Commit

Permalink
Fix #5 issue related to the selection of the audio language
Browse files Browse the repository at this point in the history
  • Loading branch information
HenestrosaDev committed Apr 23, 2023
1 parent 2e78332 commit b46e23a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/controller/main_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"ur_IN": "(اردو (بھارت",
"ur_PK": "(اردو (پاکستان",
"vi": "Tiếng Việt",
"zh_CN": "中文(中国)",
"zh": "中文(中国)",
"zh_HK": "中文(香港)",
"zh_TW": "中文(台灣)",
"zu": "Isizulu",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def load_translation(language_code: str):
_ = translation.gettext


load_translation(locale.getdefaultlocale()[0])
load_translation(locale.getdefaultlocale()[0][:2])
4 changes: 2 additions & 2 deletions src/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b46e23a

Please sign in to comment.