Skip to content

Commit

Permalink
Reverted language change order for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultrawipf committed Oct 24, 2024
1 parent efd796b commit c8a5d48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def __init__(self):
base_ui.CommunicationHandler.__init__(self)

self.profile_ui = profile_ui.ProfileUI(main=self) # load profile without UI
self.translator = PyQt6.QtCore.QTranslator(self) # Languages must be created before UI loaded
self.load_language() # load manually
#self.translator = PyQt6.QtCore.QTranslator(self) # Languages must be created before UI loaded
#self.load_language() # load manually

base_ui.WidgetUI.__init__(self, None, "MainWindow.ui")

Expand All @@ -95,15 +95,15 @@ def __init__(self):
self.lang_actions = {}
self.translator = PyQt6.QtCore.QTranslator(self)
self.language_action_group = QActionGroup(self)
self.language_action_group.setExclusive(True)
self.language_action_group.setExclusive(True)

self.tab_connections = [] # Signals to disconnect on reset

# Systray
self.systray = SystrayWrapper(self)
# Profile
self.profile_ui.initialize_ui() # Profile UI
self.make_lang_selector()
self.make_lang_selector()

self.timer = PyQt6.QtCore.QTimer(self)
self.timer.timeout.connect(self.update_timer) # pylint: disable=no-value-for-parameter
Expand Down Expand Up @@ -201,6 +201,7 @@ def setup(self):
nb_device_compat = self.serialchooser.get_ports()
self.serialchooser.auto_connect(nb_device_compat)

# TODO this function is likely not required. Remove if language changing is fixed
def load_language(self):
"""load language file in profile befor creating UI"""
app.removeTranslator(self.translator)
Expand Down Expand Up @@ -235,7 +236,6 @@ def change_language(self,enabled):
# print(f"Language file loaded: {langfile}")
self.profile_ui.set_global_setting("language",user_language) #store language

#self.refresh_widgets()
self.languagechanged.emit()

def restart_app(self):
Expand Down

0 comments on commit c8a5d48

Please sign in to comment.