[PC-BSD Commits] r4774 - pcbsd/trunk/CrashHandler

svn at pcbsd.org svn at pcbsd.org
Mon Oct 26 09:35:45 PST 2009


Author: kris
Date: 2009-10-26 10:35:44 -0700 (Mon, 26 Oct 2009)
New Revision: 4774

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

Added i18n generation to CrashHandler



Modified: pcbsd/trunk/CrashHandler/CrashHandler.pro
===================================================================
--- pcbsd/trunk/CrashHandler/CrashHandler.pro	2009-10-26 17:27:26 UTC (rev 4773)
+++ pcbsd/trunk/CrashHandler/CrashHandler.pro	2009-10-26 17:35:44 UTC (rev 4774)
@@ -81,6 +81,11 @@
 		i18n/CrashHandler_zh_TW.ts \
 		i18n/CrashHandler_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
+
 INCLUDEPATH     += /usr/PCBSD/includes /usr/local/kde4/include
 
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib

Modified: pcbsd/trunk/CrashHandler/main.cpp
===================================================================
--- pcbsd/trunk/CrashHandler/main.cpp	2009-10-26 17:27:26 UTC (rev 4773)
+++ pcbsd/trunk/CrashHandler/main.cpp	2009-10-26 17:35:44 UTC (rev 4774)
@@ -7,13 +7,12 @@
 {
     QApplication a( argc, argv );
     
-    QTranslator translator( 0 );
-    translator.load( QString("CrashHandler_") + QTextCodec::locale(), "/PCBSD/LANGS/" );
-    a.installTranslator( &translator );
+    QString locale = QLocale::system().name();
+    QTranslator translator;
+    translator.load(QString("CrashHandler_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+    a.installTranslator(&translator);
 
-    QString lang = QTextCodec::locale();
-
-    if ( lang != "vi" && lang != "zh_CN" && lang != "zh_TW" && lang != "ja" && lang != "ko" )
+    if ( locale != "vi" && locale != "zh_CN" && locale != "zh_TW" && locale != "ja" && locale != "ko" )
     {
       QFont f( "DejaVu Sans", 10);
       f.setStyleHint( QFont::SansSerif );



More information about the Commits mailing list