[PC-BSD Commits] r4771 - in pcbsd/trunk/pcbsd-netmanager/src: NetworkManagerAdmin NetworkTray ethernetconfig wificonfig

svn at pcbsd.org svn at pcbsd.org
Mon Oct 26 09:21:42 PST 2009


Author: kris
Date: 2009-10-26 10:21:41 -0700 (Mon, 26 Oct 2009)
New Revision: 4771

Modified:
   pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro
   pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp
   pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro
   pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/main.cpp
   pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro
   pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/main.cpp
   pcbsd/trunk/pcbsd-netmanager/src/wificonfig/main.cpp
   pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfig.pro
Log:

Updated other pc-netmanager tools to auto-create i18n data and install them



Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro	2009-10-26 17:21:41 UTC (rev 4771)
@@ -76,6 +76,11 @@
 		i18n/NetworkManagerAdmin_zh_TW.ts \
 		i18n/NetworkManagerAdmin_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  = pc-netadmin

Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp	2009-10-26 17:21:41 UTC (rev 4771)
@@ -30,14 +30,14 @@
 
 
     KApplication a;
-    QLocale Loc;
 
-    QString nlang = Loc.name();
+    QString locale = KGlobal::locale()->language();
+    QTranslator translator;
+    translator.load(QString("NetworkManagerAdmin_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+    a.installTranslator(&translator);
 
+
     
-    QTranslator translator( 0 );
-    translator.load( "NetworkManagerAdmin_" + nlang, KStandardDirs::locate("data", "pc-netmanager/locale/") );
-    a.installTranslator( &translator );
 
     NetworkManAdmin w;
 

Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro	2009-10-26 17:21:41 UTC (rev 4771)
@@ -71,6 +71,11 @@
 		i18n/NetworkTray_zh_TW.ts \
 		i18n/NetworkTray_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  = pc-nettray

Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/main.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/main.cpp	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/main.cpp	2009-10-26 17:21:41 UTC (rev 4771)
@@ -6,7 +6,7 @@
 #include <kcmdlineargs.h>
 #include <kuniqueapplication.h>
 #include <kstandarddirs.h>
-#include <qtranslator.h>
+#include <QTranslator>
 #include <qtextcodec.h>
 #include <QLocale>
 
@@ -37,12 +37,11 @@
 
    NetworkTray tray;
 
-   QTranslator translator( 0 );
-   QLocale mylocale(0);
-   translator.load( "NetworkTray_" + mylocale.language(), KStandardDirs::locate("data", "pc-netmanager/locale/") );
-   a.installTranslator( &translator );
+   QString locale = KGlobal::locale()->language();
+   QTranslator translator;
+   translator.load(QString("NetworkTray_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+   a.installTranslator(&translator);
 
-
    //a.setMainWidget(tray.contextMenu());
    a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
 

Modified: pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro	2009-10-26 17:21:41 UTC (rev 4771)
@@ -76,6 +76,11 @@
 		i18n/ethernetconfig_zh_TW.ts \
 		i18n/ethernetconfig_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  = pc-ethernetconfig

Modified: pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/main.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/main.cpp	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/main.cpp	2009-10-26 17:21:41 UTC (rev 4771)
@@ -22,7 +22,6 @@
  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
  ***************************************************************************/
 
-
 #include "ethernetconfig.h"
 #include <kapplication.h>
 #include <kuniqueapplication.h>
@@ -68,11 +67,12 @@
 
     ethernetconfig *mainWin = 0;
 
-    QTranslator translator( 0 );
-    QLocale mylocale(0);
-    translator.load( "ethernetconfig_" + mylocale.language(), KStandardDirs::locate("data", "pc-netmanager/locale/") );
-    app.installTranslator( &translator );
+    QString locale = KGlobal::locale()->language();
+    QTranslator translator;
+    translator.load(QString("ethernetconfig_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+    app.installTranslator(&translator);
 
+
      // no session.. just start up normally
      KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
      mainWin = new ethernetconfig();

Modified: pcbsd/trunk/pcbsd-netmanager/src/wificonfig/main.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/wificonfig/main.cpp	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/wificonfig/main.cpp	2009-10-26 17:21:41 UTC (rev 4771)
@@ -33,11 +33,10 @@
 
     KApplication a;
 
- 
-    QTranslator translator( 0 );
-    QLocale mylocale(0);
-    translator.load( "wificonfig_" + mylocale.language(), KStandardDirs::locate("data", "pc-netmanager/locale/") );
-    a.installTranslator( &translator );
+    QString locale = KGlobal::locale()->language();
+    QTranslator translator;
+    translator.load(QString("wificonfig_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+    a.installTranslator(&translator);
 
     wificonfigwidgetbase w;
     //a.setMainWidget(&w);

Modified: pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfig.pro
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfig.pro	2009-10-26 17:02:19 UTC (rev 4770)
+++ pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfig.pro	2009-10-26 17:21:41 UTC (rev 4771)
@@ -76,6 +76,11 @@
 		i18n/wificonfig_zh_TW.ts \
 		i18n/wificonfig_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  = pc-wificonfig



More information about the Commits mailing list