Skip to content
Snippets Groups Projects
Commit 63139fa8 authored by Vincent Texier's avatar Vincent Texier
Browse files

refactor swith language in a swith_language method

parent 1cc011d7
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,7 @@ class Application(QObject): ...@@ -42,6 +42,7 @@ class Application(QObject):
:param argv: The argv parameters of the call :param argv: The argv parameters of the call
''' '''
super().__init__() super().__init__()
self.qapp = qapp
self.accounts = {} self.accounts = {}
self.current_account = None self.current_account = None
self.monitor = None self.monitor = None
...@@ -57,8 +58,10 @@ class Application(QObject): ...@@ -57,8 +58,10 @@ class Application(QObject):
} }
self.load() self.load()
self.switch_language()
translator = QTranslator(qapp) def switch_language(self):
translator = QTranslator(self.qapp)
logging.debug("Loading translations") logging.debug("Loading translations")
locale = self.preferences['lang'] locale = self.preferences['lang']
QLocale.setDefault(QLocale(locale)) QLocale.setDefault(QLocale(locale))
......
...@@ -20,9 +20,11 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog): ...@@ -20,9 +20,11 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
''' '''
def __init__(self, app): def __init__(self, app):
''' """
Constructor Init instance
''' :param cutecoin.core.app.Application app: Application instance
:return:
"""
super().__init__() super().__init__()
self.setupUi(self) self.setupUi(self)
self.app = app self.app = app
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment