diff --git a/src/translations/Chinese.json b/src/translations/Chinese.json index 80bd383..1a31340 100644 --- a/src/translations/Chinese.json +++ b/src/translations/Chinese.json @@ -30,7 +30,7 @@ "text": "轻模式" }, { - "component": "randomizeIntervalCheckbox", + "component": "randomizeIntervalCheckBox", "text": "随机化间隔" } ] diff --git a/src/translations/French.json b/src/translations/French.json index 0f13d6e..b44d8b9 100644 --- a/src/translations/French.json +++ b/src/translations/French.json @@ -1,5 +1,5 @@ { - "Original": "Français", + "original": "Français", "MainWindow": [ { "component": "delayLabel", diff --git a/src/ui.py b/src/ui.py index 137c15c..395095c 100644 --- a/src/ui.py +++ b/src/ui.py @@ -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"): @@ -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)