Skip to content
Snippets Groups Projects
Commit e50ff45c authored by inso's avatar inso
Browse files

Fix preferences loading

parent e7bd27a5
No related branches found
No related tags found
No related merge requests found
......@@ -107,14 +107,13 @@ class Application(QObject):
logging.debug("Loading translations")
locale = self.preferences['lang']
QLocale.setDefault(QLocale(locale))
QCoreApplication.removeTranslator(self._translator)
self._translator = QTranslator(self.qapp)
if locale == "en_GB":
QCoreApplication.removeTranslator(self._translator)
else:
QCoreApplication.removeTranslator(self._translator)
self._translator = QTranslator(self.qapp)
if self._translator.load(":/i18n/{0}".format(locale)):
if QCoreApplication.installTranslator(self._translator):
logging.debug("Loaded i18n/{0}".format(locale))
QCoreApplication.installTranslator(self._translator)
elif self._translator.load(":/i18n/{0}".format(locale)):
if QCoreApplication.installTranslator(self._translator):
logging.debug("Loaded i18n/{0}".format(locale))
else:
logging.debug("Couldn't load translation")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment