import sys
import time
+import locale
from graph import DaysGraph
import config
# Create the application
app=QApplication(sys.argv)
+ # This returns the country and *NOT* the required locale
+ # This means that if you have'set language==en_GB and countr==Greece
+ # it will return el_GR.
+ # IOW: If you want english messages this will not work
+ #loc=QLocale.system().name()
+
+ loc=locale.setlocale(locale.LC_MESSAGES, '')
+
+ print "loc:", loc
+
# Load translations
qttr=QTranslator()
- qttr.load("qt_" + QLocale.system().name(),
+ qttr.load("qt_" + loc,
QLibraryInfo.location(QLibraryInfo.TranslationsPath))
app.installTranslator(qttr)
maetr=QTranslator()
- maetr.load("maegirls_" + QLocale.system().name(),
+ maetr.load("maegirls_" + loc,
"/usr/share/maegirls/translations")
# Install the translation