Skip to content

Commit a77476a

Browse files
author
jef
committedJun 17, 2010
fix #2815 - including more missing translation strings
git-svn-id: http://svn.osgeo.org/qgis/trunk@13744 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 986501e commit a77476a

26 files changed

+99
-91
lines changed
 

‎python/core/symbology-ng-core.sip

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,10 @@ class QgsSymbolLayerV2AbstractMetadata
774774

775775
public:
776776
/** construct metadata */
777-
QgsSymbolLayerV2AbstractMetadata( QString name, QgsSymbolV2::SymbolType type );
777+
QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, QgsSymbolV2::SymbolType type );
778778

779779
QString name() const;
780+
QString visibleName() const;
780781
QgsSymbolV2::SymbolType type() const;
781782

782783
/** create a symbol layer of this type given the map of properties. */

‎src/app/qgisapp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3760,7 +3760,7 @@ void QgisApp::labeling()
37603760
QgsMapLayer* layer = activeLayer();
37613761
if ( layer == NULL || layer->type() != QgsMapLayer::VectorLayer )
37623762
{
3763-
QMessageBox::warning( this, "Labeling", "Please select a vector layer first." );
3763+
QMessageBox::warning( this, tr( "Labeling" ), tr( "Please select a vector layer first." ) );
37643764
return;
37653765
}
37663766
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( layer );
@@ -4190,7 +4190,7 @@ void QgisApp::mergeSelectedFeatures()
41904190
const QgsFeatureIds& featureIdSet = vl->selectedFeaturesIds();
41914191
if ( featureIdSet.size() < 2 )
41924192
{
4193-
QMessageBox::information( 0, "Not enough features selected", tr( "The merge tool requires at least two selected features" ) );
4193+
QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
41944194
return;
41954195
}
41964196

@@ -4212,7 +4212,7 @@ void QgisApp::mergeSelectedFeatures()
42124212
QGis::WkbType newType = unionGeom->wkbType();
42134213
if ( providerChecksTypeStrictly && unionGeom->wkbType() != vl->wkbType() )
42144214
{
4215-
QMessageBox::critical( 0, "Union operation canceled", tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
4215+
QMessageBox::critical( 0, tr( "Union operation canceled" ), tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
42164216
delete unionGeom;
42174217
return;
42184218
}
@@ -4229,7 +4229,7 @@ void QgisApp::mergeSelectedFeatures()
42294229

42304230
if ( featureListAfter.size() < 2 )
42314231
{
4232-
QMessageBox::information( 0, "Not enough features selected", tr( "The merge tool requires at least two selected features" ) );
4232+
QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
42334233
delete unionGeom;
42344234
return;
42354235
}

‎src/app/qgscustomprojectiondialog.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
344344
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
345345
leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) );
346346
mCurrentRecordLong = 1;
347-
lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
347+
lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
348348
}
349349
}
350350
else
@@ -416,7 +416,7 @@ void QgsCustomProjectionDialog::on_pbnPrevious_clicked()
416416
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
417417
leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) ),
418418
--mCurrentRecordLong;
419-
lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
419+
lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
420420
}
421421
}
422422
else
@@ -489,7 +489,7 @@ void QgsCustomProjectionDialog::on_pbnNext_clicked()
489489
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
490490
leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) );
491491
++mCurrentRecordLong;
492-
lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
492+
lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
493493
}
494494
}
495495
else
@@ -558,7 +558,7 @@ void QgsCustomProjectionDialog::on_pbnLast_clicked()
558558
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
559559
leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) );
560560
mCurrentRecordLong = mRecordCountLong;
561-
lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
561+
lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
562562
}
563563
}
564564
else
@@ -620,7 +620,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
620620
leParameters->setText( "" );
621621
//cboProjectionFamily->setCurrentItem(0);
622622
//cboEllipsoid->setCurrentItem(0);
623-
lblRecordNo->setText( "* of " + QString::number( mRecordCountLong ) );
623+
lblRecordNo->setText( tr( "* of %1" ).arg( mRecordCountLong ) );
624624
//remember the rec we are on in case the user aborts
625625
mLastRecordLong = mCurrentRecordLong;
626626
mCurrentRecordId = "";
@@ -898,8 +898,8 @@ void QgsCustomProjectionDialog::on_pbnCalculate_clicked()
898898
int projResult = pj_transform( wgs84Proj, myProj, 1, 0, &easthing, &northing, &z );
899899
if ( projResult != 0 )
900900
{
901-
projectedX->setText( "Error" );
902-
projectedY->setText( "Error" );
901+
projectedX->setText( tr( "Error" ) );
902+
projectedY->setText( tr( "Error" ) );
903903
QgsDebugMsg( pj_strerrno( projResult ) );
904904
}
905905
else

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
145145
//cboxClassificationMode->addItem( tr( "Quantiles" ) );
146146

147147
QStringList headerLabels;
148-
headerLabels << "Value";
149-
headerLabels << "Color";
150-
headerLabels << "Label";
148+
headerLabels << tr( "Value" );
149+
headerLabels << tr( "Color" );
150+
headerLabels << tr( "Label" );
151151
mColormapTreeWidget->setHeaderLabels( headerLabels );
152152

153153
//disable colormap tab completely until 'Colormap' is selected (and only for type GrayOrUndefined)

‎src/app/qgssinglesymboldialog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,10 @@ void QgsSingleSymbolDialog::selectFillColor()
256256
//should this method have a different name?
257257
void QgsSingleSymbolDialog::selectTextureImage()
258258
{
259-
QString fileName = QFileDialog::getOpenFileName( this, "Open File",
259+
QString fileName = QFileDialog::getOpenFileName( this,
260+
tr( "Open File" ),
260261
mTexturePath,
261-
"Images (*.png *.xpm *.jpg)" ); //should we allow other types of images?
262+
tr( "Images (*.png *.xpm *.jpg)" ) ); //should we allow other types of images?
262263

263264
if ( !fileName.isNull() )
264265
{ //only process the string if the user clicked OK

‎src/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ SET(QGIS_CORE_MOC_HDRS
238238
qgsvectorlayer.h
239239
qgsrasterdataprovider.h
240240
qgsnetworkaccessmanager.h
241+
qgsvectordataprovider.h
241242

242243
composer/qgscomposerlegend.h
243244
composer/qgscomposermap.h

‎src/core/qgsapplication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool QgsApplication::notify( QObject * receiver, QEvent * event )
9191
}
9292
catch ( ... )
9393
{
94-
QMessageBox::critical( activeWindow(), tr( "Exception" ), "unknown exception" );
94+
QMessageBox::critical( activeWindow(), tr( "Exception" ), tr( "unknown exception" ) );
9595
}
9696
return done;
9797
}

‎src/core/qgsmaplayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ QString QgsMapLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
582582
QDomElement myRoot = myDocument.firstChildElement( "qgis" );
583583
if ( myRoot.isNull() )
584584
{
585-
myErrorMessage = "Error: qgis element could not be found in " + theURI;
585+
myErrorMessage = tr( "Error: qgis element could not be found in %1" ).arg( theURI );
586586
theResultFlag = false;
587587
return myErrorMessage;
588588
}

‎src/core/qgssearchtreenode.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
289289
// this error should be caught when checking syntax, but for sure...
290290
if ( mType != tOperator )
291291
{
292-
mError = "Expected operator, got scalar value!";
292+
mError = QObject::tr( "Expected operator, got scalar value!" );
293293
return false;
294294
}
295295

@@ -352,7 +352,7 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
352352
case opGE: return ( res >= 0 );
353353
case opLE: return ( res <= 0 );
354354
default:
355-
mError = "Unexpected state when evaluating operator!";
355+
mError = QObject::tr( "Unexpected state when evaluating operator!" );
356356
return false;
357357
}
358358

@@ -392,8 +392,7 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
392392
}
393393

394394
default:
395-
mError = "Unknown operator: ";
396-
mError += QString::number( mOp );
395+
mError = QObject::tr( "Unknown operator: %1" ).arg( mOp );
397396
return false;
398397
}
399398
}
@@ -414,15 +413,13 @@ bool QgsSearchTreeNode::getValue( QgsSearchTreeValue& value, QgsSearchTreeNode*
414413

415414
// these should never happen (no need to translate)
416415
case 3:
417-
mError = "Unknown operator: ";
418-
mError += value.string();
416+
mError = QObject::tr( "Unknown operator: %1" ).arg( value.string() );
419417
break;
420418
case 4:
421-
mError = "Unknown token: ";
422-
mError += value.string();
419+
mError = QObject::tr( "Unknown token: %1" ).arg( value.string() );
423420
break;
424421
default:
425-
mError = "Unknown error!";
422+
mError = QObject::tr( "Unknown error!" );
426423
break;
427424
}
428425
return false;

‎src/core/qgsvectordataprovider.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,50 +163,50 @@ QString QgsVectorDataProvider::capabilitiesString() const
163163

164164
if ( abilities & QgsVectorDataProvider::AddFeatures )
165165
{
166-
abilitiesList += "Add Features";
166+
abilitiesList += tr( "Add Features" );
167167
QgsDebugMsg( "Capability: Add Features" );
168168
}
169169

170170
if ( abilities & QgsVectorDataProvider::DeleteFeatures )
171171
{
172-
abilitiesList += "Delete Features";
172+
abilitiesList += tr( "Delete Features" );
173173
QgsDebugMsg( "Capability: Delete Features" );
174174
}
175175

176176
if ( abilities & QgsVectorDataProvider::ChangeAttributeValues )
177177
{
178-
abilitiesList += "Change Attribute Values";
178+
abilitiesList += tr( "Change Attribute Values" );
179179
QgsDebugMsg( "Capability: Change Attribute Values" );
180180
}
181181

182182
if ( abilities & QgsVectorDataProvider::AddAttributes )
183183
{
184-
abilitiesList += "Add Attributes";
184+
abilitiesList += tr( "Add Attributes" );
185185
QgsDebugMsg( "Capability: Add Attributes" );
186186
}
187187

188188
if ( abilities & QgsVectorDataProvider::DeleteAttributes )
189189
{
190-
abilitiesList += "Delete Attributes";
190+
abilitiesList += tr( "Delete Attributes" );
191191
QgsDebugMsg( "Capability: Delete Attributes" );
192192
}
193193

194194
if ( abilities & QgsVectorDataProvider::CreateSpatialIndex )
195195
{
196196
// TODO: Tighten up this test. See QgsOgrProvider for details.
197-
abilitiesList += "Create Spatial Index";
197+
abilitiesList += tr( "Create Spatial Index" );
198198
QgsDebugMsg( "Capability: Create Spatial Index" );
199199
}
200200

201201
if ( abilities & QgsVectorDataProvider::SelectAtId )
202202
{
203-
abilitiesList += "Fast Access to Features at ID";
203+
abilitiesList += tr( "Fast Access to Features at ID" );
204204
QgsDebugMsg( "Capability: Select at ID" );
205205
}
206206

207207
if ( abilities & QgsVectorDataProvider::ChangeGeometries )
208208
{
209-
abilitiesList += "Change Geometries";
209+
abilitiesList += tr( "Change Geometries" );
210210
QgsDebugMsg( "Capability: Change Geometries" );
211211
}
212212

‎src/core/qgsvectordataprovider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class QTextCodec;
3838
*/
3939
class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
4040
{
41+
Q_OBJECT
42+
4143
public:
4244

4345
// If you add to this, please also add to capabilitiesString()

‎src/core/qgsvectorlayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,14 +2844,14 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
28442844
{
28452845
if ( !myRenderer->writeXML( node, doc, *this ) )
28462846
{
2847-
errorMessage = "renderer failed to save";
2847+
errorMessage = tr( "renderer failed to save" );
28482848
return false;
28492849
}
28502850
}
28512851
else
28522852
{
28532853
QgsDebugMsg( "no renderer" );
2854-
errorMessage = "no renderer";
2854+
errorMessage = tr( "no renderer" );
28552855
return false;
28562856
}
28572857
}

‎src/core/symbology-ng/qgssymbollayerv2registry.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ QgsSymbolLayerV2Registry* QgsSymbolLayerV2Registry::mInstance = NULL;
1010
QgsSymbolLayerV2Registry::QgsSymbolLayerV2Registry()
1111
{
1212
// init registry with known symbol layers
13-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleLine", QgsSymbolV2::Line,
13+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleLine", QObject::tr( "Simple line" ), QgsSymbolV2::Line,
1414
QgsSimpleLineSymbolLayerV2::create ) );
15-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "MarkerLine", QgsSymbolV2::Line,
15+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "MarkerLine", QObject::tr( "Marker line" ), QgsSymbolV2::Line,
1616
QgsMarkerLineSymbolLayerV2::create ) );
17-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "LineDecoration", QgsSymbolV2::Line,
17+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "LineDecoration", QObject::tr( "Line decoration" ), QgsSymbolV2::Line,
1818
QgsLineDecorationSymbolLayerV2::create ) );
1919

20-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleMarker", QgsSymbolV2::Marker,
20+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleMarker", QObject::tr( "Simple marker" ), QgsSymbolV2::Marker,
2121
QgsSimpleMarkerSymbolLayerV2::create ) );
22-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SvgMarker", QgsSymbolV2::Marker,
22+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SvgMarker", QObject::tr( "SVG marker" ), QgsSymbolV2::Marker,
2323
QgsSvgMarkerSymbolLayerV2::create ) );
24-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "FontMarker", QgsSymbolV2::Marker,
24+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "FontMarker", QObject::tr( "Font marker" ), QgsSymbolV2::Marker,
2525
QgsFontMarkerSymbolLayerV2::create ) );
2626

27-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleFill", QgsSymbolV2::Fill,
27+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleFill", QObject::tr( "Simple fill" ), QgsSymbolV2::Fill,
2828
QgsSimpleFillSymbolLayerV2::create ) );
29-
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SVGFill", QgsSymbolV2::Fill, QgsSVGFillSymbolLayer::create ) );
29+
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SVGFill", QObject::tr( "SVG fill" ), QgsSymbolV2::Fill, QgsSVGFillSymbolLayer::create ) );
3030
}
3131

3232
QgsSymbolLayerV2Registry::~QgsSymbolLayerV2Registry()

‎src/core/symbology-ng/qgssymbollayerv2registry.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata
1515
{
1616
public:
17-
QgsSymbolLayerV2AbstractMetadata( QString name, QgsSymbolV2::SymbolType type )
18-
: mName( name ), mType( type ) {}
17+
QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, QgsSymbolV2::SymbolType type )
18+
: mName( name ), mVisibleName( visibleName ), mType( type ) {}
1919

2020
QString name() const { return mName; }
21+
QString visibleName() const { return mVisibleName; }
2122
QgsSymbolV2::SymbolType type() const { return mType; }
2223

2324
/** create a symbol layer of this type given the map of properties. */
@@ -27,6 +28,7 @@ class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata
2728

2829
protected:
2930
QString mName;
31+
QString mVisibleName;
3032
QgsSymbolV2::SymbolType mType;
3133
};
3234

@@ -39,10 +41,11 @@ typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )();
3941
class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMetadata
4042
{
4143
public:
42-
QgsSymbolLayerV2Metadata( QString name, QgsSymbolV2::SymbolType type,
44+
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
45+
QgsSymbolV2::SymbolType type,
4346
QgsSymbolLayerV2CreateFunc pfCreate,
4447
QgsSymbolLayerV2WidgetFunc pfWidget = NULL )
45-
: QgsSymbolLayerV2AbstractMetadata( name, type ), mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ) {}
48+
: QgsSymbolLayerV2AbstractMetadata( name, visibleName, type ), mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ) {}
4649

4750
QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc; }
4851
QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc; }

‎src/gui/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ symbology-ng/qgsvectorrandomcolorrampv2dialog.h
7474
symbology-ng/qgsvectorcolorbrewercolorrampv2dialog.h
7575
symbology-ng/characterwidget.h
7676
symbology-ng/qgspenstylecombobox.h
77+
symbology-ng/qgsbrushstylecombobox.h
7778

7879
qgsattributeeditor.h
7980
qgscomposerview.h

‎src/gui/qgscomposerview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void QgsComposerView::mousePressEvent( QMouseEvent* e )
127127
case AddLabel:
128128
{
129129
QgsComposerLabel* newLabelItem = new QgsComposerLabel( composition() );
130-
newLabelItem->setText( "Quantum GIS" );
130+
newLabelItem->setText( tr( "Quantum GIS" ) );
131131
newLabelItem->adjustSizeToText();
132132
newLabelItem->setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), newLabelItem->rect().width(), newLabelItem->rect().height() ) );
133133
addComposerLabel( newLabelItem );

‎src/gui/qgsencodingfiledialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void QgsEncodingFileDialog::addCancelAll()
9090
{
9191
if ( ! mCancelAllButton )
9292
{
93-
mCancelAllButton = new QPushButton( "Cancel &All", NULL );
93+
mCancelAllButton = new QPushButton( tr( "Cancel &All" ), NULL );
9494
layout()->addWidget( mCancelAllButton ); // Ownership transfered, no need to delete later on
9595
connect( mCancelAllButton, SIGNAL( clicked() ), this, SLOT( pbnCancelAll_clicked() ) );
9696
}

0 commit comments

Comments
 (0)