Skip to content

Commit

Permalink
Removing duplicate translator and keeping one translator instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultrawipf committed Oct 28, 2024
1 parent 45ef972 commit e75e573
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def __init__(self):
self.systray : SystrayWrapper = None

self.lang_actions = {}
self.translator = PyQt6.QtCore.QTranslator(self)
self.language_action_group = QActionGroup(self)
self.language_action_group.setExclusive(True)

Expand Down Expand Up @@ -887,9 +886,9 @@ def process_events():
restart = True
exit_code = -1
app = PyQt6.QtWidgets.QApplication(sys.argv)
translator = PyQt6.QtCore.QTranslator(app) # Translator must be created before UI loaded
while(restart):
restart = False
translator = PyQt6.QtCore.QTranslator() # Languages must be created before UI loaded
window = MainUi()
if (sys.platform == "win32" or "Windows" in sys.platform):
# only on windows, for macOS and linux use system palette.
Expand Down

0 comments on commit e75e573

Please sign in to comment.