Skip to content

Commit

Permalink
Fix chinese and french translations
Browse files Browse the repository at this point in the history
  • Loading branch information
LyubomirT committed Jul 30, 2024
1 parent b6f8289 commit 1aa721f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/translations/Chinese.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"text": "轻模式"
},
{
"component": "randomizeIntervalCheckbox",
"component": "randomizeIntervalCheckBox",
"text": "随机化间隔"
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/translations/French.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Original": "Français",
"original": "Français",
"MainWindow": [
{
"component": "delayLabel",
Expand Down
5 changes: 3 additions & 2 deletions src/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def load_translations(self):
language_code = filename[:-5] # Remove .json extension
with open(os.path.join(translations_dir, filename), "r", encoding="utf-8") as f:
self.translations[language_code] = json.load(f)
self.languageComboBox.addItem(language_code)
language_original = self.translations[language_code].get("original", "Unknown")
self.languageComboBox.addItem(language_code + " - " + language_original)

def load_theme_based_on_last_choice(self):
if not os.path.exists("theme.txt"):
Expand All @@ -137,7 +138,7 @@ def load_theme_based_on_last_choice(self):
self.toggleTheme()

def change_language(self):
self.current_language = self.languageComboBox.currentText()
self.current_language = self.languageComboBox.currentText().split(" - ")[0]
print(f"Changed language to {self.current_language}")
with open("language.txt", "w", encoding="utf-8") as f:
f.write(self.current_language)
Expand Down

0 comments on commit 1aa721f

Please sign in to comment.