[PC-BSD Commits] r4770 - pcbsd/trunk/pcbsd-netmanager/src/NetworkManager

svn at pcbsd.org svn at pcbsd.org
Mon Oct 26 09:02:19 PST 2009


Author: kris
Date: 2009-10-26 10:02:19 -0700 (Mon, 26 Oct 2009)
New Revision: 4770

Modified:
   pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/NetworkManager.pro
   pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/kcm.cpp
Log:

Updated to auto-gen i18n .qm files in the NetworkManager kcm src



Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/NetworkManager.pro
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/NetworkManager.pro	2009-10-26 16:58:07 UTC (rev 4769)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/NetworkManager.pro	2009-10-26 17:02:19 UTC (rev 4770)
@@ -84,6 +84,9 @@
 desktop.path=/usr/local/kde4/share/kde4/services/
 desktop.files=pcnetwork.desktop
 
-INSTALLS+= desktop
+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+= desktop dotrans
+
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib

Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/kcm.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/kcm.cpp	2009-10-26 16:58:07 UTC (rev 4769)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/kcm.cpp	2009-10-26 17:02:19 UTC (rev 4770)
@@ -1,12 +1,13 @@
 #include <qlayout.h>
 #include <klocale.h>
 #include <kglobal.h>
+#include <kapplication.h>
 #include <kgenericfactory.h>
 #include "networkman.h"
 #include "ui_networkman.h"
 #include <kcmodule.h>
 #include <kcm.h>
-#include <qtranslator.h>
+#include <QTranslator>
 #include <unistd.h>
 #include <sys/types.h>
 
@@ -25,9 +26,12 @@
 
   QGridLayout *layout = new QGridLayout(this);
 
-  QString LANG="NetworkManager";
-  KGlobal::locale()->insertCatalog(LANG);
+  QString locale = KGlobal::locale()->language();
+  QTranslator translator;
+  translator.load(QString("NetworkManager_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+  KApplication::installTranslator(&translator);
 
+
   netproc = new NetworkMan();
   netproc->Init();
   if ( ! checkRoot() )



More information about the Commits mailing list