[PC-BSD Commits] r5037 - pbibuild/pbi-source/PBIsource

svn at pcbsd.org svn at pcbsd.org
Tue Nov 17 07:24:41 PST 2009


Author: kris
Date: 2009-11-17 07:24:41 -0800 (Tue, 17 Nov 2009)
New Revision: 5037

Modified:
   pbibuild/pbi-source/PBIsource/main.cpp
Log:

Update i18n for PBI as well



Modified: pbibuild/pbi-source/PBIsource/main.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/main.cpp	2009-11-17 15:21:53 UTC (rev 5036)
+++ pbibuild/pbi-source/PBIsource/main.cpp	2009-11-17 15:24:41 UTC (rev 5037)
@@ -1,6 +1,7 @@
 #include <qapplication.h>
 #include <qtranslator.h>
 #include <qlocale.h>
+#include <QDebug>
 #include "pbi.h"
 
 int main( int argc, char ** argv )
@@ -9,8 +10,13 @@
 
     QTranslator translator( 0 );
     QLocale mylocale;
-    translator.load( QString("PBI_") + QLocale::languageToString(mylocale.language()), "." );
+    QString langCode = mylocale.name();
+    if ( QFile::exists("./i18n/PBI_" + langCode + ".qm" ) )
+      langCode.truncate(langCode.indexOf("_"));
+    translator.load( QString("PBI_") + langCode, "./i18n/" );
     a.installTranslator( &translator );
+    qDebug() << "Locale:" << langCode;
+
     PBI w; 
 	
     if ( argc == 2)



More information about the Commits mailing list