Skip to content
Permalink
Browse files

update grass i18n

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12660 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jan 1, 2010
1 parent 1e2883d commit 119061e6a2acb425d73b94ac1a37fe7280695df0
Showing with 13 additions and 5 deletions.
  1. +11 −5 src/plugins/grass/qgsgrassmodule.cpp
  2. +2 −0 src/plugins/grass/qgsgrassmodule.h
@@ -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 @@ QString QgsGrassModule::label( QString path )
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 @@ QgsGrassModule::~QgsGrassModule()
}
}

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,22 +2509,22 @@ QgsGrassModuleItem::QgsGrassModuleItem( QgsGrassModule *module, QString key,
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() )
{
QDomNode n = gnode.namedItem( "label" );
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 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput(
{
if ( mTitle.isEmpty() )
{
mTitle = "OGR/PostGIS/GDAL Input";
mTitle = tr("OGR/PostGIS/GDAL Input");
}
adjustTitle();

@@ -57,6 +57,8 @@ class QgsGrassModule: public QDialog, private Ui::QgsGrassModuleBase
//! Destructor
~QgsGrassModule();

QString translate( QString string );

//! Returns module label for module description path
static QString label( QString path );

0 comments on commit 119061e

Please sign in to comment.
You can’t perform that action at this time.