summaryrefslogtreecommitdiff
path: root/src/leap/app.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-20 08:20:56 +0900
committerkali <kali@leap.se>2012-12-20 08:20:56 +0900
commita7b091a0553e6120f3e0eb6d4e73a89732c589b2 (patch)
tree55036b34f7d8e92b46472218553984870c036730 /src/leap/app.py
parente98c3cc5fad75bea038dc67238e5ce85d701b1e1 (diff)
parent06bccc52c84a93407ab4699a2749b24f55fe3061 (diff)
Merge branch 'feature/translations-setup' into develop
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)