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
}

‎src/gui/qgstextannotationitem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ void QgsTextAnnotationItem::paint( QPainter * painter )
6161
mDocument->setTextWidth( mFrameSize.width() );
6262

6363
painter->save();
64-
painter->translate( mOffsetFromReferencePoint.x() + frameWidth / 2.0, mOffsetFromReferencePoint.y() + \
65-
frameWidth / 2.0 );
64+
painter->translate( mOffsetFromReferencePoint.x() + frameWidth / 2.0,
65+
mOffsetFromReferencePoint.y() + frameWidth / 2.0 );
6666

6767
//draw text document
6868
mDocument->drawContents( painter, QRectF( 0, 0, mFrameSize.width() - frameWidth / 2.0, mFrameSize.height() - frameWidth / 2.0 ) );
@@ -93,7 +93,7 @@ void QgsTextAnnotationItem::readXML( const QDomDocument& doc, const QDomElement&
9393
{
9494
delete mDocument;
9595
mDocument = new QTextDocument;
96-
mDocument->setHtml( itemElem.attribute( "document", "<html>QGIS rocks!</html>" ) );
96+
mDocument->setHtml( itemElem.attribute( "document", QObject::tr( "<html>QGIS rocks!</html>" ) ) );
9797
QDomElement annotationElem = itemElem.firstChildElement( "AnnotationItem" );
9898
if ( !annotationElem.isNull() )
9999
{

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ void CharacterWidget::mouseMoveEvent( QMouseEvent *event )
108108
QPoint widgetPosition = mapFromGlobal( event->globalPos() );
109109
uint key = ( widgetPosition.y() / squareSize ) * columns + widgetPosition.x() / squareSize;
110110

111-
QString text = QString::fromLatin1( "<p>Character: <span style=\"font-size: 24pt; font-family: %1\">" ).arg( displayFont.family() )
112-
+ QChar( key )
113-
+ QString::fromLatin1( "</span><p>Value: 0x" )
114-
+ QString::number( key, 16 );
111+
QString text = tr( "<p>Character: <span style=\"font-size: 24pt; font-family: %1%2</span><p>Value: 0x%3\">" )
112+
.arg( displayFont.family() )
113+
.arg( QChar( key ) )
114+
.arg( key, 16 );
115115
QToolTip::showText( event->globalPos(), text, this );
116116
}
117117
//! [4]

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ QgsBrushStyleComboBox::QgsBrushStyleComboBox( QWidget* parent )
1212
: QComboBox( parent )
1313
{
1414
QList < QPair<Qt::BrushStyle, QString> > styles;
15-
styles << qMakePair( Qt::SolidPattern, QString( "Solid" ) )
16-
<< qMakePair( Qt::HorPattern, QString( "Horizontal" ) )
17-
<< qMakePair( Qt::VerPattern, QString( "Vertical" ) )
18-
<< qMakePair( Qt::CrossPattern, QString( "Cross" ) )
19-
<< qMakePair( Qt::BDiagPattern, QString( "BDiagonal" ) )
20-
<< qMakePair( Qt::FDiagPattern, QString( "FDiagonal" ) )
21-
<< qMakePair( Qt::DiagCrossPattern, QString( "Diagonal X" ) )
22-
<< qMakePair( Qt::Dense1Pattern, QString( "Dense 1" ) )
23-
<< qMakePair( Qt::Dense2Pattern, QString( "Dense 2" ) )
24-
<< qMakePair( Qt::Dense3Pattern, QString( "Dense 3" ) )
25-
<< qMakePair( Qt::Dense4Pattern, QString( "Dense 4" ) )
26-
<< qMakePair( Qt::Dense5Pattern, QString( "Dense 5" ) )
27-
<< qMakePair( Qt::Dense6Pattern, QString( "Dense 6" ) )
28-
<< qMakePair( Qt::Dense7Pattern, QString( "Dense 7" ) )
29-
<< qMakePair( Qt::NoBrush, QString( "No Brush" ) );
15+
styles << qMakePair( Qt::SolidPattern, tr( "Solid" ) )
16+
<< qMakePair( Qt::HorPattern, tr( "Horizontal" ) )
17+
<< qMakePair( Qt::VerPattern, tr( "Vertical" ) )
18+
<< qMakePair( Qt::CrossPattern, tr( "Cross" ) )
19+
<< qMakePair( Qt::BDiagPattern, tr( "BDiagonal" ) )
20+
<< qMakePair( Qt::FDiagPattern, tr( "FDiagonal" ) )
21+
<< qMakePair( Qt::DiagCrossPattern, tr( "Diagonal X" ) )
22+
<< qMakePair( Qt::Dense1Pattern, tr( "Dense 1" ) )
23+
<< qMakePair( Qt::Dense2Pattern, tr( "Dense 2" ) )
24+
<< qMakePair( Qt::Dense3Pattern, tr( "Dense 3" ) )
25+
<< qMakePair( Qt::Dense4Pattern, tr( "Dense 4" ) )
26+
<< qMakePair( Qt::Dense5Pattern, tr( "Dense 5" ) )
27+
<< qMakePair( Qt::Dense6Pattern, tr( "Dense 6" ) )
28+
<< qMakePair( Qt::Dense7Pattern, tr( "Dense 7" ) )
29+
<< qMakePair( Qt::NoBrush, tr( "No Brush" ) );
3030

3131
setIconSize( QSize( 32, 16 ) );
3232

‎src/gui/symbology-ng/qgsbrushstylecombobox.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
class GUI_EXPORT QgsBrushStyleComboBox : public QComboBox
88
{
9+
Q_OBJECT
10+
911
public:
1012
QgsBrushStyleComboBox( QWidget* parent = NULL );
1113

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto
4848
populateColorRamps();
4949
QStandardItemModel* mg = new QStandardItemModel( this );
5050
QStringList labels;
51-
labels << "Range" << "Label";
51+
labels << tr( "Range" ) << tr( "Label" );
5252
mg->setHorizontalHeaderLabels( labels );
5353
viewGraduated->setModel( mg );
5454

@@ -218,7 +218,7 @@ void QgsGraduatedSymbolRendererV2Widget::populateRanges()
218218
mRowSelected = -1;
219219

220220
QStringList labels;
221-
labels << "Symbol" << "Range" << "Label";
221+
labels << tr( "Symbol" ) << tr( "Range" ) << tr( "Label" );
222222
m->setHorizontalHeaderLabels( labels );
223223

224224
QSize iconSize( 16, 16 );

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ QgsPenStyleComboBox::QgsPenStyleComboBox( QWidget* parent )
1313
: QComboBox( parent )
1414
{
1515
QList < QPair<Qt::PenStyle, QString> > styles;
16-
styles << qMakePair( Qt::SolidLine, QString( "Solid Line" ) )
17-
<< qMakePair( Qt::DashLine, QString( "Dash Line" ) )
18-
<< qMakePair( Qt::DotLine, QString( "Dot Line" ) )
19-
<< qMakePair( Qt::DashDotLine, QString( "Dash Dot Line" ) )
20-
<< qMakePair( Qt::DashDotDotLine, QString( "Dash Dot Dot Line" ) )
21-
<< qMakePair( Qt::NoPen, QString( "No Pen" ) );
16+
styles << qMakePair( Qt::SolidLine, tr( "Solid Line" ) )
17+
<< qMakePair( Qt::DashLine, tr( "Dash Line" ) )
18+
<< qMakePair( Qt::DotLine, tr( "Dot Line" ) )
19+
<< qMakePair( Qt::DashDotLine, tr( "Dash Dot Line" ) )
20+
<< qMakePair( Qt::DashDotDotLine, tr( "Dash Dot Dot Line" ) )
21+
<< qMakePair( Qt::NoPen, tr( "No Pen" ) );
2222

2323
setIconSize( QSize( 32, 12 ) );
2424

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void QgsRendererRulesTreeWidget::populateRulesNoGrouping()
421421
if ( txt.isEmpty() ) txt = tr( "(no filter)" );
422422
if ( rule.dependsOnScale() )
423423
{
424-
txt += QString( ", scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
424+
txt += tr( ", scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
425425
}
426426

427427
item->setText( 0, txt );
@@ -447,9 +447,9 @@ void QgsRendererRulesTreeWidget::populateRulesGroupByScale()
447447
{
448448
QString txt;
449449
if ( rule.dependsOnScale() )
450-
txt = QString( "scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
450+
txt = tr( "scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
451451
else
452-
txt = "any scale";
452+
txt = tr( "any scale" );
453453

454454
QTreeWidgetItem* scale_item = new QTreeWidgetItem;
455455
scale_item->setText( 0, txt );

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SymbolLayerItem : public QStandardItem
4343
QVariant data( int role ) const
4444
{
4545
if ( role == Qt::DisplayRole )
46-
return QVariant( mLayer->layerType() );
46+
return QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( mLayer->layerType() )->visibleName();
4747
if ( role == Qt::SizeHintRole )
4848
return QVariant( QSize( 32, 32 ) );
4949
if ( role == Qt::CheckStateRole )
@@ -162,7 +162,7 @@ void QgsSymbolV2PropertiesDialog::populateLayerTypes()
162162

163163
cboLayerType->clear();
164164
for ( int i = 0; i < types.count(); i++ )
165-
cboLayerType->addItem( types[i] );
165+
cboLayerType->addItem( QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( types[i] )->visibleName(), types[i] );
166166
}
167167

168168

@@ -285,7 +285,7 @@ void QgsSymbolV2PropertiesDialog::layerChanged()
285285
return;
286286

287287
// update layer type combo box
288-
int idx = cboLayerType->findText( layer->layerType() );
288+
int idx = cboLayerType->findData( layer->layerType() );
289289
cboLayerType->setCurrentIndex( idx );
290290

291291
updateSymbolLayerWidget( layer );
@@ -308,7 +308,7 @@ void QgsSymbolV2PropertiesDialog::layerTypeChanged()
308308
QgsSymbolLayerV2* layer = currentLayer();
309309
if ( layer == NULL ) return;
310310

311-
QString newLayerType = cboLayerType->currentText();
311+
QString newLayerType = cboLayerType->itemData( cboLayerType->currentIndex() ).toString();
312312
if ( layer->layerType() == newLayerType )
313313
return;
314314

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ void QgsSymbolV2SelectorDialog::setLineWidth( double width )
210210
void QgsSymbolV2SelectorDialog::addSymbolToStyle()
211211
{
212212
bool ok;
213-
QString name = QInputDialog::getText( this, "Symbol name",
214-
"Please enter name for the symbol:", QLineEdit::Normal, "New symbol", &ok );
213+
QString name = QInputDialog::getText( this, tr( "Symbol name" ),
214+
tr( "Please enter name for the symbol:" ) , QLineEdit::Normal, tr( "New symbol" ), &ok );
215215
if ( !ok || name.isEmpty() )
216216
return;
217217

0 commit comments

Comments
 (0)
Please sign in to comment.