Skip to content

Commit 594d1aa

Browse files
committedDec 17, 2016
translation string fixes
1 parent 17ac6ac commit 594d1aa

File tree

3 files changed

+97
-26
lines changed

3 files changed

+97
-26
lines changed
 

‎src/app/dwg/qgsdwgimporter.cpp

Lines changed: 94 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,11 @@ void QgsDwgImporter::addHeader( const DRW_Header *data )
776776

777777
if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
778778
{
779-
LOG( QObject::tr( "Could not add header record %1 [%2]" ).arg( k, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
779+
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
780+
.arg( k )
781+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
782+
.arg( QObject::tr( "header record" ) )
783+
);
780784
}
781785

782786
OGR_F_Destroy( f );
@@ -844,7 +848,11 @@ void QgsDwgImporter::addLType( const DRW_LType &data )
844848

845849
if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
846850
{
847-
LOG( QObject::tr( "Could not add add line type %1 [%2]" ).arg( data.name.c_str() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
851+
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
852+
.arg( data.name.c_str() )
853+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
854+
.arg( QObject::tr( "line type" ) )
855+
);
848856
}
849857

850858
OGR_F_Destroy( f );
@@ -930,7 +938,11 @@ void QgsDwgImporter::addLayer( const DRW_Layer &data )
930938

931939
if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
932940
{
933-
LOG( QObject::tr( "Could not add add layer %1 [%2]" ).arg( data.name.c_str(), QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
941+
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
942+
.arg( data.name.c_str() )
943+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
944+
.arg( QObject::tr( "layer" ) )
945+
);
934946
}
935947

936948
OGR_F_Destroy( f );
@@ -1130,7 +1142,11 @@ void QgsDwgImporter::addDimStyle( const DRW_Dimstyle &data )
11301142

11311143
if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
11321144
{
1133-
LOG( QObject::tr( "Could not add add layer %1 [%2]" ).arg( data.name.c_str() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1145+
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
1146+
.arg( data.name.c_str() )
1147+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1148+
.arg( QObject::tr( "dimension style" ) )
1149+
);
11341150
}
11351151

11361152
OGR_F_Destroy( f );
@@ -1162,7 +1178,11 @@ void QgsDwgImporter::addTextStyle( const DRW_Textstyle &data )
11621178

11631179
if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
11641180
{
1165-
LOG( QObject::tr( "Could not add add text style %1 [%2]" ).arg( data.name.c_str() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1181+
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
1182+
.arg( data.name.c_str() )
1183+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1184+
.arg( QObject::tr( "text style" ) )
1185+
);
11661186
}
11671187

11681188
OGR_F_Destroy( f );
@@ -1223,7 +1243,10 @@ void QgsDwgImporter::addBlock( const DRW_Block &data )
12231243

12241244
if ( !createFeature( layer, f, p ) )
12251245
{
1226-
LOG( QObject::tr( "Could not add block [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1246+
LOG( QObject::tr( "Could not add %2 [%1]" )
1247+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1248+
.arg( QObject::tr( "block" ) )
1249+
);
12271250
}
12281251
}
12291252

@@ -1281,7 +1304,10 @@ void QgsDwgImporter::addPoint( const DRW_Point &data )
12811304
QgsPointV2 p( QgsWkbTypes::PointZ, data.basePoint.x, data.basePoint.y, data.basePoint.z );
12821305
if ( !createFeature( layer, f, p ) )
12831306
{
1284-
LOG( QObject::tr( "Could not add point [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1307+
LOG( QObject::tr( "Could not add %2 [%1]" )
1308+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1309+
.arg( QObject::tr( "point" ) )
1310+
);
12851311
}
12861312
}
12871313

@@ -1332,7 +1358,10 @@ void QgsDwgImporter::addArc( const DRW_Arc &data )
13321358

13331359
if ( !createFeature( layer, f, c ) )
13341360
{
1335-
LOG( QObject::tr( "Could not add arc [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1361+
LOG( QObject::tr( "Could not add %2 [%1]" )
1362+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1363+
.arg( QObject::tr( "arc" ) )
1364+
);
13361365
}
13371366
}
13381367

@@ -1360,7 +1389,10 @@ void QgsDwgImporter::addCircle( const DRW_Circle &data )
13601389

13611390
if ( !createFeature( layer, f, c ) )
13621391
{
1363-
LOG( QObject::tr( "Could not add circle [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1392+
LOG( QObject::tr( "Could not add %2 [%1]" )
1393+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1394+
.arg( QObject::tr( "circle" ) )
1395+
);
13641396
}
13651397
}
13661398

@@ -1509,7 +1541,10 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
15091541

15101542
if ( !createFeature( layer, f, cc ) )
15111543
{
1512-
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1544+
LOG( QObject::tr( "Could not add %2 [%1]" )
1545+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1546+
.arg( QObject::tr( "line string" ) )
1547+
);
15131548
}
15141549

15151550
cc.clear();
@@ -1578,7 +1613,10 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
15781613

15791614
if ( !createFeature( layer, f, poly ) )
15801615
{
1581-
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1616+
LOG( QObject::tr( "Could not add %2 [%1]" )
1617+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1618+
.arg( QObject::tr( "polygon" ) )
1619+
);
15821620
}
15831621
}
15841622
}
@@ -1622,7 +1660,10 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
16221660

16231661
if ( !createFeature( layer, f, cc ) )
16241662
{
1625-
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1663+
LOG( QObject::tr( "Could not add %2 [%1]" )
1664+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1665+
.arg( QObject::tr( "line string" ) )
1666+
);
16261667
}
16271668
}
16281669
}
@@ -1701,7 +1742,10 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
17011742

17021743
if ( !createFeature( layer, f, cc ) )
17031744
{
1704-
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1745+
LOG( QObject::tr( "Could not add %2 [%1]" )
1746+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1747+
.arg( QObject::tr( "line string" ) )
1748+
);
17051749
}
17061750

17071751
cc.clear();
@@ -1775,7 +1819,10 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
17751819

17761820
if ( !createFeature( layer, f, poly ) )
17771821
{
1778-
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1822+
LOG( QObject::tr( "Could not add %2 [%1]" )
1823+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1824+
.arg( QObject::tr( "polygon" ) )
1825+
);
17791826
}
17801827
}
17811828
}
@@ -1819,7 +1866,10 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
18191866

18201867
if ( !createFeature( layer, f, cc ) )
18211868
{
1822-
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
1869+
LOG( QObject::tr( "Could not add %2 [%1]" )
1870+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
1871+
.arg( QObject::tr( "line string" ) )
1872+
);
18231873
}
18241874
}
18251875
}
@@ -2058,7 +2108,10 @@ void QgsDwgImporter::addSpline( const DRW_Spline *data )
20582108

20592109
if ( !createFeature( layer, f, l ) )
20602110
{
2061-
LOG( QObject::tr( "Could not add spline [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2111+
LOG( QObject::tr( "Could not add %2 [%1]" )
2112+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2113+
.arg( QObject::tr( "spline" ) )
2114+
);
20622115
}
20632116
}
20642117

@@ -2097,7 +2150,10 @@ void QgsDwgImporter::addInsert( const DRW_Insert &data )
20972150

20982151
if ( !createFeature( layer, f, p ) )
20992152
{
2100-
LOG( QObject::tr( "Could not add point [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2153+
LOG( QObject::tr( "Could not add %2 [%1]" )
2154+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2155+
.arg( QObject::tr( "point" ) )
2156+
);
21012157
}
21022158
}
21032159

@@ -2146,7 +2202,10 @@ void QgsDwgImporter::addSolid( const DRW_Solid &data )
21462202

21472203
if ( !createFeature( layer, f, poly ) )
21482204
{
2149-
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2205+
LOG( QObject::tr( "Could not add %2 [%1]" )
2206+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2207+
.arg( QObject::tr( "polygon" ) )
2208+
);
21502209
}
21512210
}
21522211

@@ -2179,7 +2238,10 @@ void QgsDwgImporter::addMText( const DRW_MText &data )
21792238

21802239
if ( !createFeature( layer, f, p ) )
21812240
{
2182-
LOG( QObject::tr( "Could not add line [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2241+
LOG( QObject::tr( "Could not add %2 [%1]" )
2242+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2243+
.arg( QObject::tr( "point" ) )
2244+
);
21832245
}
21842246
}
21852247

@@ -2213,7 +2275,10 @@ void QgsDwgImporter::addText( const DRW_Text &data )
22132275

22142276
if ( !createFeature( layer, f, p ) )
22152277
{
2216-
LOG( QObject::tr( "Could not add line [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2278+
LOG( QObject::tr( "Could not add %2 [%1]" )
2279+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2280+
.arg( QObject::tr( "point" ) )
2281+
);
22172282
}
22182283
}
22192284

@@ -2320,7 +2385,7 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
23202385
ls->setPoints( QgsPointSequence()
23212386
<< QgsPointV2( QgsWkbTypes::PointZ, l->basePoint.x, l->basePoint.y, l->basePoint.z )
23222387
<< QgsPointV2( QgsWkbTypes::PointZ, l->secPoint.x, l->secPoint.y, l->secPoint.z ) );
2323-
// QgsDebugMsg( QString( "add linestring:%1" ).arg( ls->asWkt() ) );
2388+
// QgsDebugMsg( QString( "add line string:%1" ).arg( ls->asWkt() ) );
23242389
cc->addCurve( ls );
23252390
}
23262391
else
@@ -2343,7 +2408,10 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
23432408

23442409
if ( !createFeature( layer, f, p ) )
23452410
{
2346-
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2411+
LOG( QObject::tr( "Could not add %2 [%1]" )
2412+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2413+
.arg( QObject::tr( "polygon" ) )
2414+
);
23472415
}
23482416
}
23492417

@@ -2370,7 +2438,10 @@ void QgsDwgImporter::addLine( const DRW_Line& data )
23702438

23712439
if ( !createFeature( layer, f, l ) )
23722440
{
2373-
LOG( QObject::tr( "Could not add line [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
2441+
LOG( QObject::tr( "Could not add %2 [%1]" )
2442+
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
2443+
.arg( QObject::tr( "line string" ) )
2444+
);
23742445
}
23752446
}
23762447

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9656,7 +9656,7 @@ bool QgisApp::checkTasksDependOnProject()
96569656
{
96579657
Q_FOREACH ( QgsTask* task, tasks )
96589658
{
9659-
activeTaskDescriptions.insert( tr( " • %1" ).arg( task->description() ) );
9659+
activeTaskDescriptions.insert( trUtf8( " • %1" ).arg( task->description() ) );
96609660
}
96619661
}
96629662
}

‎src/gui/symbology-ng/qgsstylemanagerdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle* style, QWidget* parent )
6060
mSplitter->restoreState( settings.value( QStringLiteral( "/Windows/StyleV2Manager/splitter" ) ).toByteArray() );
6161

6262
tabItemType->setDocumentMode( true );
63-
searchBox->setPlaceholderText( tr( "Filter symbols…" ) );
63+
searchBox->setPlaceholderText( trUtf8( "Filter symbols…" ) );
6464

6565
connect( this, SIGNAL( finished( int ) ), this, SLOT( onFinished() ) );
6666

@@ -244,7 +244,7 @@ void QgsStyleManagerDialog::on_tabItemType_currentChanged( int )
244244
{
245245
// when in Color Ramp tab, add menu to add item button and hide "Export symbols as PNG/SVG"
246246
bool flag = currentItemType() != 3;
247-
searchBox->setPlaceholderText( flag ? tr( "Filter symbols…" ) : tr( "Filter color ramps…" ) );
247+
searchBox->setPlaceholderText( flag ? trUtf8( "Filter symbols…" ) : trUtf8( "Filter color ramps…" ) );
248248
btnAddItem->setMenu( flag ? nullptr : mMenuBtnAddItemColorRamp );
249249
actnExportAsPNG->setVisible( flag );
250250
actnExportAsSVG->setVisible( flag );

0 commit comments

Comments
 (0)
Please sign in to comment.