Skip to content

Commit

Permalink
translation string fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 17, 2016
1 parent 17ac6ac commit 594d1aa
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 26 deletions.
117 changes: 94 additions & 23 deletions src/app/dwg/qgsdwgimporter.cpp
Expand Up @@ -776,7 +776,11 @@ void QgsDwgImporter::addHeader( const DRW_Header *data )

if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not add header record %1 [%2]" ).arg( k, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
.arg( k )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "header record" ) )
);
}

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

if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not add add line type %1 [%2]" ).arg( data.name.c_str() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
.arg( data.name.c_str() )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "line type" ) )
);
}

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

if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not add add layer %1 [%2]" ).arg( data.name.c_str(), QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
.arg( data.name.c_str() )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "layer" ) )
);
}

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

if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not add add layer %1 [%2]" ).arg( data.name.c_str() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
.arg( data.name.c_str() )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "dimension style" ) )
);
}

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

if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not add add text style %1 [%2]" ).arg( data.name.c_str() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
.arg( data.name.c_str() )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "text style" ) )
);
}

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

if ( !createFeature( layer, f, p ) )
{
LOG( QObject::tr( "Could not add block [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "block" ) )
);
}
}

Expand Down Expand Up @@ -1281,7 +1304,10 @@ void QgsDwgImporter::addPoint( const DRW_Point &data )
QgsPointV2 p( QgsWkbTypes::PointZ, data.basePoint.x, data.basePoint.y, data.basePoint.z );
if ( !createFeature( layer, f, p ) )
{
LOG( QObject::tr( "Could not add point [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "point" ) )
);
}
}

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

if ( !createFeature( layer, f, c ) )
{
LOG( QObject::tr( "Could not add arc [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "arc" ) )
);
}
}

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

if ( !createFeature( layer, f, c ) )
{
LOG( QObject::tr( "Could not add circle [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "circle" ) )
);
}
}

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

if ( !createFeature( layer, f, cc ) )
{
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "line string" ) )
);
}

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

if ( !createFeature( layer, f, poly ) )
{
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "polygon" ) )
);
}
}
}
Expand Down Expand Up @@ -1622,7 +1660,10 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )

if ( !createFeature( layer, f, cc ) )
{
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "line string" ) )
);
}
}
}
Expand Down Expand Up @@ -1701,7 +1742,10 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )

if ( !createFeature( layer, f, cc ) )
{
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "line string" ) )
);
}

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

if ( !createFeature( layer, f, poly ) )
{
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "polygon" ) )
);
}
}
}
Expand Down Expand Up @@ -1819,7 +1866,10 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )

if ( !createFeature( layer, f, cc ) )
{
LOG( QObject::tr( "Could not add linestring [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "line string" ) )
);
}
}
}
Expand Down Expand Up @@ -2058,7 +2108,10 @@ void QgsDwgImporter::addSpline( const DRW_Spline *data )

if ( !createFeature( layer, f, l ) )
{
LOG( QObject::tr( "Could not add spline [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "spline" ) )
);
}
}

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

if ( !createFeature( layer, f, p ) )
{
LOG( QObject::tr( "Could not add point [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "point" ) )
);
}
}

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

if ( !createFeature( layer, f, poly ) )
{
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "polygon" ) )
);
}
}

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

if ( !createFeature( layer, f, p ) )
{
LOG( QObject::tr( "Could not add line [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "point" ) )
);
}
}

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

if ( !createFeature( layer, f, p ) )
{
LOG( QObject::tr( "Could not add line [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "point" ) )
);
}
}

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

if ( !createFeature( layer, f, p ) )
{
LOG( QObject::tr( "Could not add polygon [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "polygon" ) )
);
}
}

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

if ( !createFeature( layer, f, l ) )
{
LOG( QObject::tr( "Could not add line [%1]" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
LOG( QObject::tr( "Could not add %2 [%1]" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "line string" ) )
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -9656,7 +9656,7 @@ bool QgisApp::checkTasksDependOnProject()
{
Q_FOREACH ( QgsTask* task, tasks )
{
activeTaskDescriptions.insert( tr( " • %1" ).arg( task->description() ) );
activeTaskDescriptions.insert( trUtf8( " • %1" ).arg( task->description() ) );
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology-ng/qgsstylemanagerdialog.cpp
Expand Up @@ -60,7 +60,7 @@ QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle* style, QWidget* parent )
mSplitter->restoreState( settings.value( QStringLiteral( "/Windows/StyleV2Manager/splitter" ) ).toByteArray() );

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

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

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

0 comments on commit 594d1aa

Please sign in to comment.