[PC-BSD Commits] r4777 - pcbsd/trunk/SystemUpdaterTray

svn at pcbsd.org svn at pcbsd.org
Mon Oct 26 09:43:55 PST 2009


Author: kris
Date: 2009-10-26 10:43:55 -0700 (Mon, 26 Oct 2009)
New Revision: 4777

Modified:
   pcbsd/trunk/SystemUpdaterTray/SystemUpdaterTray.pro
   pcbsd/trunk/SystemUpdaterTray/main.cpp
Log:

Added i18n auto-gen to SystemUpdaterTray



Modified: pcbsd/trunk/SystemUpdaterTray/SystemUpdaterTray.pro
===================================================================
--- pcbsd/trunk/SystemUpdaterTray/SystemUpdaterTray.pro	2009-10-26 17:42:10 UTC (rev 4776)
+++ pcbsd/trunk/SystemUpdaterTray/SystemUpdaterTray.pro	2009-10-26 17:43:55 UTC (rev 4777)
@@ -76,6 +76,11 @@
 		i18n/SystemUpdaterTray_zh_TW.ts \
 		i18n/SystemUpdaterTray_zu.ts
 
+dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+
+INSTALLS += dotrans
+
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
 
 TARGET  = SystemUpdaterTray

Modified: pcbsd/trunk/SystemUpdaterTray/main.cpp
===================================================================
--- pcbsd/trunk/SystemUpdaterTray/main.cpp	2009-10-26 17:42:10 UTC (rev 4776)
+++ pcbsd/trunk/SystemUpdaterTray/main.cpp	2009-10-26 17:43:55 UTC (rev 4777)
@@ -34,12 +34,11 @@
    //a.setMainWidget(tray.contextMenu());
    a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
 
-   
-   QTranslator translator( 0 );
-   QLocale mylocale;
-   translator.load( QString("SystemUpdaterTray__") + QLocale::languageToString(mylocale.language()), "." );
-   a.installTranslator( &translator );
 
+   QString locale = KGlobal::locale()->language();
+   QTranslator translator;
+   translator.load(QString("SystemUpdaterTray_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+   a.installTranslator(&translator);
 
    // Init our program
    tray.programInit();



More information about the Commits mailing list