Skip to content

Commit d61480b

Browse files
author
homann
committedMar 18, 2007
Added i18n patch #666...
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6816 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 327ce8a commit d61480b

12 files changed

+53
-53
lines changed
 

‎src/gui/qgsattributetabledisplay.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void QgsAttributeTableDisplay::addAttribute()
133133
{
134134
if(!table()->addAttribute(dialog.name(),dialog.type()))
135135
{
136-
QMessageBox::information(0,"Name conflict","The attribute could not be inserted. The name already exists in the table",QMessageBox::Ok);
136+
QMessageBox::information(0,tr("Name conflict"),tr("The attribute could not be inserted. The name already exists in the table"),QMessageBox::Ok);
137137
}
138138
}
139139
}
@@ -182,12 +182,12 @@ void QgsAttributeTableDisplay::stopEditing()
182182
if(table()->edited())
183183
{
184184
//commit or roll back?
185-
int commit=QMessageBox::information(0,"Stop editing","Do you want to save the changes?",QMessageBox::Yes,QMessageBox::No);
185+
int commit=QMessageBox::information(0,tr("Stop editing"),tr("Do you want to save the changes?"),QMessageBox::Yes,QMessageBox::No);
186186
if(commit==QMessageBox::Yes)
187187
{
188188
if(!table()->commitChanges(mLayer))
189189
{
190-
QMessageBox::information(0,"Error","Could not commit changes",QMessageBox::Ok);
190+
QMessageBox::information(0,tr("Error"),tr("Could not commit changes"),QMessageBox::Ok);
191191
}
192192
}
193193
else

‎src/gui/qgscustomprojectiondialog.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
414414
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
415415
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
416416
mCurrentRecordLong=1;
417-
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
417+
lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong));
418418
}
419419
else
420420
{
@@ -490,7 +490,7 @@ void QgsCustomProjectionDialog::on_pbnPrevious_clicked()
490490
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
491491
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4))),
492492
--mCurrentRecordLong;
493-
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
493+
lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong));
494494
}
495495
else
496496
{
@@ -568,7 +568,7 @@ void QgsCustomProjectionDialog::on_pbnNext_clicked()
568568
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
569569
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
570570
++mCurrentRecordLong;
571-
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
571+
lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong));
572572
}
573573
else
574574
{
@@ -641,7 +641,7 @@ void QgsCustomProjectionDialog::on_pbnLast_clicked()
641641
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
642642
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
643643
mCurrentRecordLong =mRecordCountLong;
644-
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
644+
lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong));
645645
}
646646
else
647647
{
@@ -710,7 +710,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
710710
leParameters->setText("");
711711
//cboProjectionFamily->setCurrentItem(0);
712712
//cboEllipsoid->setCurrentItem(0);
713-
lblRecordNo->setText("* of " + QString::number(mRecordCountLong));
713+
lblRecordNo->setText( tr("* of ") + QString::number(mRecordCountLong));
714714
//remember the rec we are on in case the user aborts
715715
mLastRecordLong=mCurrentRecordLong;
716716
mCurrentRecordId="";

‎src/gui/qgsgraduatedsymboldialog.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ QgsGraduatedSymbolDialog::QgsGraduatedSymbolDialog(QgsVectorLayer * layer): QDia
6262
return;
6363
}
6464

65-
modeComboBox->insertItem("Empty");
66-
modeComboBox->insertItem("Equal Interval");
65+
modeComboBox->insertItem( tr("Empty") );
66+
modeComboBox->insertItem( tr("Equal Interval") );
6767

6868
//restore the correct settings
6969
const QgsGraduatedSymbolRenderer* renderer = dynamic_cast < const QgsGraduatedSymbolRenderer * >(layer->renderer());
@@ -253,7 +253,7 @@ void QgsGraduatedSymbolDialog::adjustClassification()
253253

254254
if (provider)
255255
{
256-
if (modeComboBox->currentText() == "Equal Interval")
256+
if (modeComboBox->currentText() == tr("Equal Interval") )
257257
{
258258
minimum = provider->minValue(field).toDouble();
259259
maximum = provider->maxValue(field).toDouble();
@@ -274,12 +274,12 @@ void QgsGraduatedSymbolDialog::adjustClassification()
274274
QPen pen;
275275
QBrush brush;
276276

277-
if (modeComboBox->currentText() == "Empty")
277+
if (modeComboBox->currentText() == tr("Empty") )
278278
{
279-
listboxtext="Empty"+QString::number(i+1);
279+
listboxtext= tr("Empty") + QString::number(i+1);
280280
mClassBreakBox->insertItem(listboxtext);
281281
}
282-
else if(modeComboBox->currentText() == "Equal Interval")
282+
else if(modeComboBox->currentText() == tr("Equal Interval") )
283283
{
284284
double lower=minimum + (maximum - minimum) / numberofclassesspinbox->value() * i;
285285
double upper=minimum + (maximum - minimum) / numberofclassesspinbox->value() * (i+1);

‎src/gui/qgsmapserverexport.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ bool QgsMapserverExport::write()
7070
// Check for file and prompt for overwrite if it exists
7171
if (QFile::exists(txtMapFilePath->text()))
7272
{
73-
okToSave = QMessageBox::warning(0, "Overwrite File?", txtMapFilePath->text() +
74-
" exists. \nDo you want to overwrite it?", "Yes", "No");
73+
okToSave = QMessageBox::warning(0, tr("Overwrite File?"), txtMapFilePath->text() +
74+
tr(" exists. \nDo you want to overwrite it?"), tr("Yes"), tr("No"));
7575
}
7676
if (okToSave == 0)
7777
{
@@ -203,7 +203,7 @@ void QgsMapserverExport::writeMapFile()
203203
mapFile << " NAME " << name.toLocal8Bit().data() << std::endl;
204204
// feature type
205205
#ifdef QGISDEBUG
206-
std::cout << "\tMapsrver Export checking feature type" << std::endl;
206+
std::cout << "\tMapserver Export checking feature type" << std::endl;
207207
#endif
208208
mapFile << " TYPE ";
209209
switch (lyr->featureType())
@@ -231,7 +231,7 @@ void QgsMapserverExport::writeMapFile()
231231
mapFile << std::endl;
232232

233233
#ifdef QGISDEBUG
234-
std::cout << "\tMapsrver Export checking visibility" << std::endl;
234+
std::cout << "\tMapserver Export checking visibility" << std::endl;
235235
#endif
236236
// set visibility (STATUS)
237237
mapFile << " STATUS ";
@@ -247,7 +247,7 @@ void QgsMapserverExport::writeMapFile()
247247
// data source (DATA)
248248
// Data source spec depends on layer type
249249
#ifdef QGISDEBUG
250-
std::cout << "\tMapsrver Export checking layer type" << std::endl;
250+
std::cout << "\tMapserver Export checking layer type" << std::endl;
251251
#endif
252252
switch (lyr->type())
253253
{
@@ -301,14 +301,14 @@ void QgsMapserverExport::writeMapFile()
301301
//QListViewItem *li = map->getLegend()->currentItem();
302302
// return li->text(0);
303303
#ifdef QGISDEBUG
304-
std::cout << "\tMapsrver Export symbol name" << std::endl;
304+
std::cout << "\tMapserver Export symbol name" << std::endl;
305305
#endif
306306
mapFile << " NAME \"" << lyr->name().toLocal8Bit().data() << "\"" << std::endl;
307307
mapFile << " # TEMPLATE" << std::endl;
308308
if (isPolygon)
309309
{
310310
#ifdef QGISDEBUG
311-
std::cout << "\tMapsrver Export symbol fill color" << std::endl;
311+
std::cout << "\tMapserver Export symbol fill color" << std::endl;
312312
#endif
313313
// use random fill colors
314314
// TODO Get fill color from the renderer
@@ -322,7 +322,7 @@ void QgsMapserverExport::writeMapFile()
322322
mapFile << " COLOR " << red << " " << green << " " << blue << std::endl;
323323
}
324324
#ifdef QGISDEBUG
325-
std::cout << "\tMapsrver Export checking for line symbol " << std::endl;
325+
std::cout << "\tMapserver Export checking for line symbol " << std::endl;
326326
#endif
327327
if (isPolygon || isLine)
328328
{
@@ -337,7 +337,7 @@ void QgsMapserverExport::writeMapFile()
337337
mapFile << " END" << std::endl;
338338
mapFile << "END" << std::endl;
339339
#ifdef QGISDEBUG
340-
std::cout << "\tMapsrver Export layer definition done..." << std::endl;
340+
std::cout << "\tMapserver Export layer definition done..." << std::endl;
341341
#endif
342342
}
343343
if (!chkExpLayersOnly->isChecked())
@@ -362,9 +362,9 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
362362
{
363363
QString s = QFileDialog::getSaveFileName(
364364
this,
365-
"Choose a filename for the exported map file",
365+
tr("Choose a filename for the exported map file"),
366366
"./",
367-
"Mapserver files (*.map)" );
367+
tr("Mapserver files (*.map)" ) );
368368
txtMapFilePath->setText(s);
369369
}
370370

@@ -373,6 +373,6 @@ void QgsMapserverExport::on_buttonHelp_clicked()
373373
//QMessageBox::information(this, "Help","Help");
374374
QgsHelpViewer *hv = new QgsHelpViewer(this);
375375
// causes problems in qt3.1.x: hv->setModal(false);
376-
hv->setCaption("QGIS Help - Mapserver Export");
376+
hv->setCaption( tr("QGIS Help - Mapserver Export") );
377377
hv->show();
378378
}

‎src/gui/qgsmaptoolcapture.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ void QgsMapToolCapture::canvasReleaseEvent(QMouseEvent * e)
7878

7979
if (!vlayer)
8080
{
81-
QMessageBox::information(0,"Not a vector layer","The current layer is not a vector layer",QMessageBox::Ok);
81+
QMessageBox::information(0, QObject::tr("Not a vector layer"), QObject::tr("The current layer is not a vector layer"),QMessageBox::Ok);
8282
return;
8383
}
8484

8585
if (!vlayer->isEditable())
8686
{
87-
QMessageBox::information(0,"Layer not editable",
88-
"Cannot edit the vector layer. To make it editable, go to the file item of the layer, right click and check 'Allow Editing'.",
87+
QMessageBox::information(0,QObject::tr("Layer not editable"),
88+
QObject::tr("Cannot edit the vector layer. To make it editable, go to the file item of the layer, right click and check 'Allow Editing'."),
8989
QMessageBox::Ok);
9090
return;
9191
}
@@ -98,8 +98,8 @@ void QgsMapToolCapture::canvasReleaseEvent(QMouseEvent * e)
9898
//check we only use this tool for point/multipoint layers
9999
if(vlayer->vectorType() != QGis::Point)
100100
{
101-
QMessageBox::information(0,"Wrong editing tool", "Cannot apply the 'capture point' tool on this vector layer",\
102-
QMessageBox::Ok);
101+
QMessageBox::information(0, QObject::tr("Wrong editing tool"), QObject::tr("Cannot apply the 'capture point' tool on this vector layer"),
102+
QMessageBox::Ok);
103103
return;
104104
}
105105
QgsPoint idPoint = toMapCoords(e->pos());
@@ -182,15 +182,15 @@ QMessageBox::Ok);
182182
//check we only use the line tool for line/multiline layers
183183
if(mTool == CaptureLine && vlayer->vectorType() != QGis::Line)
184184
{
185-
QMessageBox::information(0,"Wrong editing tool", "Cannot apply the 'capture line' tool on this vector layer",\
185+
QMessageBox::information(0,QObject::tr("Wrong editing tool"), QObject::tr("Cannot apply the 'capture line' tool on this vector layer"),\
186186
QMessageBox::Ok);
187187
return;
188188
}
189189

190190
//check we only use the polygon tool for polygon/multipolygon layers
191191
if(mTool == CapturePolygon && vlayer->vectorType() != QGis::Polygon)
192192
{
193-
QMessageBox::information(0,"Wrong editing tool", "Cannot apply the 'capture polygon' tool on this vector layer",\
193+
QMessageBox::information(0,QObject::tr("Wrong editing tool"), QObject::tr("Cannot apply the 'capture polygon' tool on this vector layer"),\
194194
QMessageBox::Ok);
195195
return;
196196
}

‎src/gui/qgsmaptoolvertexedit.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
114114
//Find nearest segment of the selected line, move that node to the mouse location
115115
if (!snapSegmentWithContext(point))
116116
{
117-
QMessageBox::warning(0, "Error",
117+
QMessageBox::warning(0, QObject::tr("Error"),
118118
QObject::tr("Could not snap segment. Have you set the tolerance in Settings > Project Properties > General?"),
119119
QMessageBox::Ok, Qt::NoButton);
120120
return;
@@ -159,7 +159,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
159159
{
160160
if(!snapVertexWithContext(snapPoint))
161161
{
162-
QMessageBox::warning(0, "Error",
162+
QMessageBox::warning(0, QObject::tr("Error"),
163163
QObject::tr("Could not snap segment. Have you set the tolerance in Settings > Project Properties > General?"),
164164
QMessageBox::Ok, Qt::NoButton);
165165
return;
@@ -169,7 +169,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
169169
{
170170
if (!snapSegmentWithContext(snapPoint))
171171
{
172-
QMessageBox::warning(0, "Error",
172+
QMessageBox::warning(0, QObject::tr("Error"),
173173
QObject::tr("Could not snap segment. Have you set the tolerance in Settings > Project Properties > General?"),
174174
QMessageBox::Ok, Qt::NoButton);
175175
return;
@@ -178,7 +178,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
178178
snapPoint = point;
179179
if (!snapVertexOfSnappedSegment(snapPoint))
180180
{
181-
QMessageBox::warning(0, "Error",
181+
QMessageBox::warning(0, QObject::tr("Error"),
182182
QObject::tr("Could not snap vertex. Have you set the tolerance in Settings > Project Properties > General?"),
183183
QMessageBox::Ok, Qt::NoButton);
184184
return;
@@ -227,7 +227,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
227227
// TODO: Find nearest segment of the selected line, move that node to the mouse location
228228
if (!snapVertexWithContext(point))
229229
{
230-
QMessageBox::warning(0, "Error",
230+
QMessageBox::warning(0, QObject::tr("Error"),
231231
QObject::tr("Could not snap vertex. Have you set the tolerance in Settings > Project Properties > General?"),
232232
QMessageBox::Ok, Qt::NoButton);
233233
return;
@@ -395,22 +395,22 @@ void QgsMapToolVertexEdit::canvasReleaseEvent(QMouseEvent * e)
395395

396396
if (!vlayer)
397397
{
398-
QMessageBox::information(0,"Not a vector layer","The current layer is not a vector layer",QMessageBox::Ok);
398+
QMessageBox::information(0, QObject::tr("Not a vector layer"), QObject::tr("The current layer is not a vector layer"), QMessageBox::Ok);
399399
return;
400400
}
401401

402402
if (!(vlayer->getDataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries))
403403
{
404-
QMessageBox::information(0,"Change geometry",
405-
"Data provider of the current layer doesn't allow changing geometries",
404+
QMessageBox::information(0, QObject::tr("Change geometry"),
405+
QObject::tr("Data provider of the current layer doesn't allow changing geometries"),
406406
QMessageBox::Ok);
407407
return;
408408
}
409409

410410
if (!vlayer->isEditable())
411411
{
412-
QMessageBox::information(0,"Layer not editable",
413-
"Cannot edit the vector layer. Use 'Start editing' in the legend item menu",
412+
QMessageBox::information(0, QObject::tr("Layer not editable"),
413+
QObject::tr("Cannot edit the vector layer. Use 'Start editing' in the legend item menu"),
414414
QMessageBox::Ok);
415415
return;
416416
}

‎src/gui/qgsmarkerdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ QString QgsMarkerDialog::selectedMarker()
6868
void QgsMarkerDialog::changeDirectory()
6969
{
7070
QString newdir = QFileDialog::getExistingDirectory(
71-
this, "Choose a directory", mCurrentDir);
71+
this, tr("Choose a directory"), mCurrentDir);
7272
if (!newdir.isEmpty())
7373
{
7474
mCurrentDir=newdir;

‎src/gui/qgsoptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void QgsOptions::on_btnFindBrowser_clicked()
239239
#endif
240240
QString browser = QFileDialog::getOpenFileName(
241241
this,
242-
"Choose a browser",
242+
tr("Choose a browser"),
243243
"./",
244244
filter );
245245
if(browser.length() > 0)

‎src/gui/qgspgquerybuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void QgsPgQueryBuilder::on_btnSampleValues_clicked()
212212

213213
}else
214214
{
215-
QMessageBox::warning(this, tr("Database error"), tr("<p>Failed to get sample of field values using SQL:</p><p>") + sql + "</p><p>Error message was: "+ QString(PQerrorMessage(mPgConnection)) + "</p>");
215+
QMessageBox::warning(this, tr("Database error"), tr("<p>Failed to get sample of field values using SQL:</p><p>") + sql + tr("</p><p>Error message was: ")+ QString(PQerrorMessage(mPgConnection)) + "</p>");
216216
}
217217
// free the result set
218218
PQclear(result);
@@ -267,7 +267,7 @@ void QgsPgQueryBuilder::on_btnTest_clicked()
267267
// if there is no sql, issue a warning
268268
if(txtSQL->text().isEmpty())
269269
{
270-
QMessageBox::information(this, "No Query", "You must create a query before you can test it");
270+
QMessageBox::information(this, tr("No Query"), tr("You must create a query before you can test it"));
271271
}
272272
else
273273
{
@@ -334,7 +334,7 @@ void QgsPgQueryBuilder::on_btnOk_clicked()
334334
if(numRecs == -1)
335335
{
336336
//error in query - show the problem
337-
QMessageBox::warning(this,"Error in Query", mPgErrorMessage);
337+
QMessageBox::warning(this,tr("Error in Query"), mPgErrorMessage);
338338
}
339339
else
340340
{

‎src/gui/qgssearchquerybuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ QgsSearchQueryBuilder::QgsSearchQueryBuilder(QgsVectorLayer* layer,
3131
{
3232
setupUi(this);
3333

34-
setWindowTitle("Search query builder");
34+
setWindowTitle(tr("Search query builder"));
3535

3636
// disable unsupported operators
3737
btnIn->setEnabled(false);

‎src/gui/qgsspatialrefsys.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,8 +1291,8 @@ int QgsSpatialRefSys::openDb(QString path, sqlite3 **db)
12911291
// XXX This will likely never happen since on open, sqlite creates the
12921292
// database if it does not exist.
12931293
// ... unfortunately it happens on Windows
1294-
QMessageBox::warning(0,"Error","Could not open SRS database "
1295-
+ path + "<br>Error(" + QString::number(myResult)
1294+
QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not open SRS database ")
1295+
+ path + QObject::tr("<br>Error(") + QString::number(myResult)
12961296
+ "): " + QString(sqlite3_errmsg(*db)) );
12971297

12981298
}

‎src/gui/qgsvectorlayerproperties.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ QString QgsVectorLayerProperties::getMetadata()
503503
QgsDebug( cse.what() );
504504

505505
myMetadataQString += "<tr><td bgcolor=\"white\">";
506-
myMetadataQString += tr("In project spatial reference system units : ");
507-
myMetadataQString += " (Invalid transformation of layer extents) ";
506+
myMetadataQString += tr("In project spatial reference system units: ");
507+
myMetadataQString += tr(" (Invalid transformation of layer extents) ");
508508
myMetadataQString += "</td></tr>";
509509

510510
}

0 commit comments

Comments
 (0)
Please sign in to comment.