Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update grass i18n
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12660 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 1, 2010
1 parent 1e2883d commit 119061e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -43,6 +43,7 @@
extern "C"
{
#include <grass/Vect.h>
#include <grass/glocale.h>
}

#include <gdal.h> // to collect version information
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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() )
Expand Down Expand Up @@ -2583,7 +2589,7 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput(
{
if ( mTitle.isEmpty() )
{
mTitle = "OGR/PostGIS/GDAL Input";
mTitle = tr("OGR/PostGIS/GDAL Input");
}
adjustTitle();

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/grass/qgsgrassmodule.h
Expand Up @@ -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 );

Expand Down

0 comments on commit 119061e

Please sign in to comment.