traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso Main.cpp


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/traverso Main.cpp
Date: Mon, 02 Feb 2009 20:26:41 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       09/02/02 20:26:41

Modified files:
        src/traverso   : Main.cpp 

Log message:
        * make it possible to load traverso with another language then the 
system one, needs a selection button somewere in the preferences dialog, anyone 
knows a good place ?

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Main.cpp?cvsroot=traverso&r1=1.11&r2=1.12

Patches:
Index: Main.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/Main.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- Main.cpp    6 Aug 2008 13:54:32 -0000       1.11
+++ Main.cpp    2 Feb 2009 20:26:41 -0000       1.12
@@ -25,6 +25,8 @@
 #include <QLocale>
 #include <QTranslator>
 #include <QtPlugin>
+
+#include "Config.h"
 #include "Traverso.h"
 #include "Main.h"
 #include "../config.h"
@@ -114,10 +116,17 @@
        traverso = new Traverso(argc, argv);
        
        QTranslator traversoTranslator;
-       QString language = QLocale::system().name();
-       traversoTranslator.load(":/traverso_" + language );
+       QString systemLanguage = QLocale::system().name();
+       QString userLanguage = config().get_property("Interface", "Language", 
"").toString();
+       if (userLanguage.isEmpty() || userLanguage.isNull()) {
+               traversoTranslator.load(":/traverso_" + systemLanguage );
+       } else {
+               traversoTranslator.load(":/traverso_" + userLanguage );
+       }
        traverso->installTranslator(&traversoTranslator);
+       
        traverso->exec();
+       
        delete traverso;
 
        MEM_OFF();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]