diff options
author | drebs <drebs@leap.se> | 2012-12-24 10:14:58 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2012-12-24 10:14:58 -0200 |
commit | 319e279b59ac080779d0a3375ae4d6582f5ee6a3 (patch) | |
tree | 118dd0f495c0d54f2b2c66ea235e4e4e6b8cefd5 /src/leap/app.py | |
parent | ca5fb41a55e1292005ed186baf3710831d9ad678 (diff) | |
parent | a7b091a0553e6120f3e0eb6d4e73a89732c589b2 (diff) |
Merge branch 'develop' of ssh://code.leap.se/leap_client into develop
Diffstat (limited to 'src/leap/app.py')
-rw-r--r-- | src/leap/app.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/leap/app.py b/src/leap/app.py index d594c7cd..334b58c8 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -8,10 +8,11 @@ import sip sip.setapi('QVariant', 2) sip.setapi('QString', 2) from PyQt4.QtGui import (QApplication, QSystemTrayIcon, QMessageBox) -from PyQt4.QtCore import QTimer +from PyQt4 import QtCore from leap import __version__ as VERSION from leap.baseapp.mainwindow import LeapWindow +from leap.gui import locale_rc def sigint_handler(*args, **kwargs): @@ -62,6 +63,17 @@ def main(): logger.info('Starting app') app = QApplication(sys.argv) + # To test: + # $ LANG=es ./app.py + locale = QtCore.QLocale.system().name() + print locale + qtTranslator = QtCore.QTranslator() + if qtTranslator.load("qt_%s" % locale, ":/translations"): + app.installTranslator(qtTranslator) + appTranslator = QtCore.QTranslator() + if appTranslator.load("leap_client_%s" % locale, ":/translations"): + app.installTranslator(appTranslator) + # needed for initializing qsettings # it will write .config/leap/leap.conf # top level app settings @@ -83,7 +95,7 @@ def main(): # this dummy timer ensures that # control is given to the outside loop, so we # can hook our sigint handler. - timer = QTimer() + timer = QtCore.QTimer() timer.start(500) timer.timeout.connect(lambda: None) |