summaryrefslogtreecommitdiff
path: root/src/leap/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/app.py')
-rw-r--r--src/leap/app.py16
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)