[QGIS Commit] r12660 - trunk/qgis/src/plugins/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Dec 31 21:29:29 EST 2009


Author: jef
Date: 2009-12-31 21:29:28 -0500 (Thu, 31 Dec 2009)
New Revision: 12660

Modified:
   trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
   trunk/qgis/src/plugins/grass/qgsgrassmodule.h
Log:
update grass i18n

Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2009-12-31 16:51:57 UTC (rev 12659)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2010-01-01 02:29:28 UTC (rev 12660)
@@ -43,6 +43,7 @@
 extern "C"
 {
 #include <grass/Vect.h>
+#include <grass/glocale.h>
 }
 
 #include <gdal.h>         // to collect version information
@@ -941,7 +942,7 @@
   qFile.close();
   QDomElement qDocElem = qDoc.documentElement();
 
-  return QApplication::translate( "grasslabel", qDocElem.attribute( "label" ).toUtf8() );
+  return QApplication::translate( "grasslabel", qDocElem.attribute( "label" ).trimmed().toUtf8() );
 }
 
 QPixmap QgsGrassModule::pixmap( QString path, int height )
@@ -1491,6 +1492,11 @@
   }
 }
 
+QString QgsGrassModule::translate( QString msg )
+{
+  return QString::fromUtf8( G_gettext( "grassmods", msg.trimmed().toUtf8() ) );
+}
+
 QDomNode QgsGrassModule::nodeByKey( QDomElement elem, QString key )
 {
   QgsDebugMsg( "called with key=" + key );
@@ -2503,7 +2509,7 @@
   QString label, description;
   if ( !qdesc.attribute( "label" ).isEmpty() )
   {
-    label = QApplication::translate( "grasslabel", qdesc.attribute( "label" ).toUtf8() );
+    label = QApplication::translate( "grasslabel", qdesc.attribute( "label" ).trimmed().toUtf8() );
   }
   if ( label.isEmpty() )
   {
@@ -2511,14 +2517,14 @@
     if ( !n.isNull() )
     {
       QDomElement e = n.toElement();
-      label = QApplication::translate( "grasslabel", e.text().toUtf8() );
+      label = module->translate( e.text() );
     }
   }
   QDomNode n = gnode.namedItem( "description" );
   if ( !n.isNull() )
   {
     QDomElement e = n.toElement();
-    description = QApplication::translate( "grasslabel", e.text().toUtf8() );
+    description = module->translate( e.text() );
   }
 
   if ( !label.isEmpty() )
@@ -2583,7 +2589,7 @@
 {
   if ( mTitle.isEmpty() )
   {
-    mTitle = "OGR/PostGIS/GDAL Input";
+    mTitle = tr("OGR/PostGIS/GDAL Input");
   }
   adjustTitle();
 

Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.h
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.h	2009-12-31 16:51:57 UTC (rev 12659)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.h	2010-01-01 02:29:28 UTC (rev 12660)
@@ -57,6 +57,8 @@
     //! Destructor
     ~QgsGrassModule();
 
+    QString translate( QString string );
+
     //! Returns module label for module description path
     static QString label( QString path );
 



More information about the QGIS-commit mailing list