Skip to content

Commit 119061e

Browse files
author
jef
committedJan 1, 2010
update grass i18n
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12660 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed
 

‎src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
extern "C"
4444
{
4545
#include <grass/Vect.h>
46+
#include <grass/glocale.h>
4647
}
4748

4849
#include <gdal.h> // to collect version information
@@ -941,7 +942,7 @@ QString QgsGrassModule::label( QString path )
941942
qFile.close();
942943
QDomElement qDocElem = qDoc.documentElement();
943944

944-
return QApplication::translate( "grasslabel", qDocElem.attribute( "label" ).toUtf8() );
945+
return QApplication::translate( "grasslabel", qDocElem.attribute( "label" ).trimmed().toUtf8() );
945946
}
946947

947948
QPixmap QgsGrassModule::pixmap( QString path, int height )
@@ -1491,6 +1492,11 @@ QgsGrassModule::~QgsGrassModule()
14911492
}
14921493
}
14931494

1495+
QString QgsGrassModule::translate( QString msg )
1496+
{
1497+
return QString::fromUtf8( G_gettext( "grassmods", msg.trimmed().toUtf8() ) );
1498+
}
1499+
14941500
QDomNode QgsGrassModule::nodeByKey( QDomElement elem, QString key )
14951501
{
14961502
QgsDebugMsg( "called with key=" + key );
@@ -2503,22 +2509,22 @@ QgsGrassModuleItem::QgsGrassModuleItem( QgsGrassModule *module, QString key,
25032509
QString label, description;
25042510
if ( !qdesc.attribute( "label" ).isEmpty() )
25052511
{
2506-
label = QApplication::translate( "grasslabel", qdesc.attribute( "label" ).toUtf8() );
2512+
label = QApplication::translate( "grasslabel", qdesc.attribute( "label" ).trimmed().toUtf8() );
25072513
}
25082514
if ( label.isEmpty() )
25092515
{
25102516
QDomNode n = gnode.namedItem( "label" );
25112517
if ( !n.isNull() )
25122518
{
25132519
QDomElement e = n.toElement();
2514-
label = QApplication::translate( "grasslabel", e.text().toUtf8() );
2520+
label = module->translate( e.text() );
25152521
}
25162522
}
25172523
QDomNode n = gnode.namedItem( "description" );
25182524
if ( !n.isNull() )
25192525
{
25202526
QDomElement e = n.toElement();
2521-
description = QApplication::translate( "grasslabel", e.text().toUtf8() );
2527+
description = module->translate( e.text() );
25222528
}
25232529

25242530
if ( !label.isEmpty() )
@@ -2583,7 +2589,7 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput(
25832589
{
25842590
if ( mTitle.isEmpty() )
25852591
{
2586-
mTitle = "OGR/PostGIS/GDAL Input";
2592+
mTitle = tr("OGR/PostGIS/GDAL Input");
25872593
}
25882594
adjustTitle();
25892595

‎src/plugins/grass/qgsgrassmodule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class QgsGrassModule: public QDialog, private Ui::QgsGrassModuleBase
5757
//! Destructor
5858
~QgsGrassModule();
5959

60+
QString translate( QString string );
61+
6062
//! Returns module label for module description path
6163
static QString label( QString path );
6264

0 commit comments

Comments
 (0)
Please sign in to comment.