Added error hotkey translation

This commit is contained in:
LOUDO 2024-05-29 21:47:36 +02:00
parent 45320147eb
commit 105a5b921d
5 changed files with 17 additions and 12 deletions

View File

@ -30,7 +30,7 @@ class HotkeysManager:
self.index_to_change = index
self.changeKey = True
self.entry_to_change = entry_to_change
self.entry_to_change.configure(text="Please key")
self.entry_to_change.configure(text=self.main_app.text_content["options_menu"]["settings_menu"]["hotkeys_settings"]["please_key_text"])
def clearHotKey(self, type, entry_to_change):
self.settings.change_settings("Hotkeys", type, None, [])
@ -72,10 +72,10 @@ class HotkeysManager:
and userSettings["Hotkeys"]["Record_Start"] == self.hotkeys
):
messagebox.showerror(
"Error",
"You can't have same hotkeys on start record and start playback.",
self.main_app.text_content["global"]["error"],
self.main_app.text_content["options_menu"]["settings_menu"]["hotkeys_settings"]["error_hotkeys"],
)
self.entry_to_change.configure(text="Please key")
self.entry_to_change.configure(text=self.main_app.text_content["options_menu"]["settings_menu"]["hotkeys_settings"]["please_key_text"])
self.hotkeys = []
self.hotkey_visible = []
return

View File

@ -92,7 +92,8 @@
"start_playback_text": "Start playback",
"stop_playback_text": "Stop playback",
"clear_text": "Clear",
"please_key_text": "Please key"
"please_key_text": "Please key",
"error_hotkeys": "You can't have same hotkeys on start record and start playback"
},
"minimization_text": "Minimization",
"minimization_menu": {

View File

@ -92,7 +92,8 @@
"start_playback_text": "Jouer la lecture",
"stop_playback_text": "Stop la lecture",
"clear_text": "Effacer",
"please_key_text": "Touche svp"
"please_key_text": "Touche svp",
"error_hotkeys": "Vous ne pouvez pas avoir les mêmes touches de raccourci au démarrage de l'enregistrement et au démarrage de la lecture."
},
"minimization_text": "Minimisation",
"minimization_menu": {

View File

@ -2,13 +2,14 @@ import requests
from requests.exceptions import RequestException
class Version:
def __init__(self, userSettings):
def __init__(self, userSettings, main_app):
self.main_app = main_app
self.version = "1.1.7"
self.new_version = ""
if userSettings["Others"]["Check_update"]:
self.update = self.checkVersion()
else:
self.update = "Check update disabled"
self.update = self.main_app.text_content["help_menu"]["about_settings"]["version_check_update_text"]["disabled"]
def checkVersion(self):
api_url = f'https://api.github.com/repos/LOUDO56/PyMacroRecord/releases/latest'
@ -19,8 +20,10 @@ class Version:
if response.status_code == 200:
release_data = response.json()
self.new_version = release_data['tag_name'].replace('v', '')
return "Outdated" if self.new_version != self.version else "Up to Date"
return self.main_app.text_content["help_menu"]["about_settings"]["version_check_update_text"]["outdated"] \
if self.new_version != self.version \
else self.main_app.text_content["help_menu"]["about_settings"]["version_check_update_text"]["up_to_date"]
else:
return "Cannot fetch if new update"
return self.main_app.text_content["help_menu"]["about_settings"]["version_check_update_text"]["failed"]
except RequestException:
return "Cannot fetch if new update"
return self.main_app.text_content["help_menu"]["about_settings"]["version_check_update_text"]["failed"]

View File

@ -48,7 +48,7 @@ class MainApp(Window):
self.macro_recorded = False
self.prevent_record = False
self.version = Version(self.settings.get_config())
self.version = Version(self.settings.get_config(), self)
self.menu = MenuBar(self) # Menu Bar
self.macro = Macro(self)