|
43 | 43 | extern "C" |
44 | 44 | { |
45 | 45 | #include <grass/Vect.h> |
| 46 | +#include <grass/glocale.h> |
46 | 47 | } |
47 | 48 |
|
48 | 49 | #include <gdal.h> // to collect version information |
@@ -941,7 +942,7 @@ QString QgsGrassModule::label( QString path ) |
941 | 942 | qFile.close(); |
942 | 943 | QDomElement qDocElem = qDoc.documentElement(); |
943 | 944 |
|
944 | | - return QApplication::translate( "grasslabel", qDocElem.attribute( "label" ).toUtf8() ); |
| 945 | + return QApplication::translate( "grasslabel", qDocElem.attribute( "label" ).trimmed().toUtf8() ); |
945 | 946 | } |
946 | 947 |
|
947 | 948 | QPixmap QgsGrassModule::pixmap( QString path, int height ) |
@@ -1491,6 +1492,11 @@ QgsGrassModule::~QgsGrassModule() |
1491 | 1492 | } |
1492 | 1493 | } |
1493 | 1494 |
|
| 1495 | +QString QgsGrassModule::translate( QString msg ) |
| 1496 | +{ |
| 1497 | + return QString::fromUtf8( G_gettext( "grassmods", msg.trimmed().toUtf8() ) ); |
| 1498 | +} |
| 1499 | + |
1494 | 1500 | QDomNode QgsGrassModule::nodeByKey( QDomElement elem, QString key ) |
1495 | 1501 | { |
1496 | 1502 | QgsDebugMsg( "called with key=" + key ); |
@@ -2503,22 +2509,22 @@ QgsGrassModuleItem::QgsGrassModuleItem( QgsGrassModule *module, QString key, |
2503 | 2509 | QString label, description; |
2504 | 2510 | if ( !qdesc.attribute( "label" ).isEmpty() ) |
2505 | 2511 | { |
2506 | | - label = QApplication::translate( "grasslabel", qdesc.attribute( "label" ).toUtf8() ); |
| 2512 | + label = QApplication::translate( "grasslabel", qdesc.attribute( "label" ).trimmed().toUtf8() ); |
2507 | 2513 | } |
2508 | 2514 | if ( label.isEmpty() ) |
2509 | 2515 | { |
2510 | 2516 | QDomNode n = gnode.namedItem( "label" ); |
2511 | 2517 | if ( !n.isNull() ) |
2512 | 2518 | { |
2513 | 2519 | QDomElement e = n.toElement(); |
2514 | | - label = QApplication::translate( "grasslabel", e.text().toUtf8() ); |
| 2520 | + label = module->translate( e.text() ); |
2515 | 2521 | } |
2516 | 2522 | } |
2517 | 2523 | QDomNode n = gnode.namedItem( "description" ); |
2518 | 2524 | if ( !n.isNull() ) |
2519 | 2525 | { |
2520 | 2526 | QDomElement e = n.toElement(); |
2521 | | - description = QApplication::translate( "grasslabel", e.text().toUtf8() ); |
| 2527 | + description = module->translate( e.text() ); |
2522 | 2528 | } |
2523 | 2529 |
|
2524 | 2530 | if ( !label.isEmpty() ) |
@@ -2583,7 +2589,7 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput( |
2583 | 2589 | { |
2584 | 2590 | if ( mTitle.isEmpty() ) |
2585 | 2591 | { |
2586 | | - mTitle = "OGR/PostGIS/GDAL Input"; |
| 2592 | + mTitle = tr("OGR/PostGIS/GDAL Input"); |
2587 | 2593 | } |
2588 | 2594 | adjustTitle(); |
2589 | 2595 |
|
|
0 commit comments