Skip to content

Commit bfc6c02

Browse files
committed
Improve grass translation templates
1 parent 068da62 commit bfc6c02

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/providers/grass/qgsgrass.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ bool QgsGrass::init( void )
366366
}
367367
G_CATCH( QgsGrass::Exception &e )
368368
{
369-
mInitError = tr( "Problem in GRASS initialization, GRASS provider and plugin will not work" ) + " : " + e.what();
369+
mInitError = tr( "Problem in GRASS initialization, GRASS provider and plugin will not work : %1" ).arg( e.what() );
370370
QgsDebugMsg( mInitError );
371371
mNonInitializable = true;
372372
unlock();
@@ -699,7 +699,7 @@ void QgsGrass::removeMapsetFromSearchPath( const QString & mapset, QString& erro
699699
}
700700
catch ( QgsGrass::Exception &e )
701701
{
702-
error = tr( "Cannot remove mapset %1 from search path:" ).arg( mapset ) + " " + e.what();
702+
error = tr( "Cannot remove mapset %1 from search path: %2" ).arg( mapset, e.what() );
703703
}
704704
}
705705

@@ -959,7 +959,7 @@ QString QgsGrass::openMapset( const QString& gisdbase,
959959

960960
if ( process.exitStatus() != QProcess::NormalExit || process.exitCode() != 0 )
961961
{
962-
QString message = QObject::tr( "Mapset lock failed" ) + " (" + processResult + ")";
962+
QString message = QObject::tr( "Mapset lock failed (%1)" ).arg( processResult );
963963
return message;
964964
}
965965

@@ -1857,7 +1857,7 @@ bool QgsGrass::mapRegion( QgsGrassObject::Type type, QString gisdbase,
18571857
if ( type == QgsGrassObject::Raster )
18581858
{
18591859

1860-
QString error = tr( "Cannot read raster map region" ) + " (" + gisdbase + "/" + location + "/" + mapset + ")";
1860+
QString error = tr( "Cannot read raster map region (%1/%2/%3)" ).arg( gisdbase, location, mapset );
18611861
#if GRASS_VERSION_MAJOR < 7
18621862
if ( G_get_cellhd( map.toUtf8().data(),
18631863
mapset.toUtf8().data(), window ) < 0 )
@@ -2173,7 +2173,7 @@ QgsCoordinateReferenceSystem QgsGrass::crs( const QString& gisdbase, const QStri
21732173
}
21742174
catch ( QgsGrass::Exception &e )
21752175
{
2176-
error = tr( "Cannot get projection " ) + "\n" + e.what();
2176+
error = tr( "Cannot get projection" ) + "\n" + e.what();
21772177
QgsDebugMsg( error );
21782178
}
21792179

@@ -2583,8 +2583,7 @@ void QgsGrass::insertRow( dbDriver *driver, const QString tableName,
25832583
db_free_string( &dbstr );
25842584
if ( result != DB_OK )
25852585
{
2586-
throw QgsGrass::Exception( QObject::tr( "Cannot insert, statement" ) + ": " + sql
2587-
+ QObject::tr( "error" ) + ": " + QString::fromLatin1( db_get_error_msg() ) );
2586+
throw QgsGrass::Exception( QObject::tr( "Cannot insert, statement: '%1' error: '%2'" ).arg( sql, QString::fromLatin1( db_get_error_msg() ) ) );
25882587
}
25892588
}
25902589

@@ -2621,7 +2620,7 @@ void QgsGrass::adjustCellHead( struct Cell_head *cellhd, int row_flag, int col_f
26212620
char* err = G_adjust_Cell_head( cellhd, row_flag, col_flag );
26222621
if ( err )
26232622
{
2624-
throw QgsGrass::Exception( QObject::tr( "Cannot adjust region" ) + QString( err ) );
2623+
throw QgsGrass::Exception( QObject::tr( "Cannot adjust region, error: '%1'" ).arg( err ) );
26252624
}
26262625
#else
26272626
G_FATAL_THROW( G_adjust_Cell_head( cellhd, row_flag, col_flag ) );

0 commit comments

Comments
 (0)