Index: src/gui/qgsmaptoolvertexedit.cpp =================================================================== --- src/gui/qgsmaptoolvertexedit.cpp (revision 6811) +++ src/gui/qgsmaptoolvertexedit.cpp (working copy) @@ -114,7 +114,7 @@ //Find nearest segment of the selected line, move that node to the mouse location if (!snapSegmentWithContext(point)) { - QMessageBox::warning(0, "Error", + QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not snap segment. Have you set the tolerance in Settings > Project Properties > General?"), QMessageBox::Ok, Qt::NoButton); return; @@ -159,7 +159,7 @@ { if(!snapVertexWithContext(snapPoint)) { - QMessageBox::warning(0, "Error", + QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not snap segment. Have you set the tolerance in Settings > Project Properties > General?"), QMessageBox::Ok, Qt::NoButton); return; @@ -169,7 +169,7 @@ { if (!snapSegmentWithContext(snapPoint)) { - QMessageBox::warning(0, "Error", + QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not snap segment. Have you set the tolerance in Settings > Project Properties > General?"), QMessageBox::Ok, Qt::NoButton); return; @@ -178,7 +178,7 @@ snapPoint = point; if (!snapVertexOfSnappedSegment(snapPoint)) { - QMessageBox::warning(0, "Error", + QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not snap vertex. Have you set the tolerance in Settings > Project Properties > General?"), QMessageBox::Ok, Qt::NoButton); return; @@ -227,7 +227,7 @@ // TODO: Find nearest segment of the selected line, move that node to the mouse location if (!snapVertexWithContext(point)) { - QMessageBox::warning(0, "Error", + QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not snap vertex. Have you set the tolerance in Settings > Project Properties > General?"), QMessageBox::Ok, Qt::NoButton); return; @@ -395,22 +395,22 @@ if (!vlayer) { - QMessageBox::information(0,"Not a vector layer","The current layer is not a vector layer",QMessageBox::Ok); + QMessageBox::information(0, QObject::tr("Not a vector layer"), QObject::tr("The current layer is not a vector layer"), QMessageBox::Ok); return; } if (!(vlayer->getDataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries)) { - QMessageBox::information(0,"Change geometry", - "Data provider of the current layer doesn't allow changing geometries", + QMessageBox::information(0, QObject::tr("Change geometry"), + QObject::tr("Data provider of the current layer doesn't allow changing geometries"), QMessageBox::Ok); return; } if (!vlayer->isEditable()) { - QMessageBox::information(0,"Layer not editable", - "Cannot edit the vector layer. Use 'Start editing' in the legend item menu", + QMessageBox::information(0, QObject::tr("Layer not editable"), + QObject::tr("Cannot edit the vector layer. Use 'Start editing' in the legend item menu"), QMessageBox::Ok); return; } Index: src/gui/qgscustomprojectiondialog.cpp =================================================================== --- src/gui/qgscustomprojectiondialog.cpp (revision 6811) +++ src/gui/qgscustomprojectiondialog.cpp (working copy) @@ -414,7 +414,7 @@ //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId)); leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4))); mCurrentRecordLong=1; - lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong)); + lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong)); } else { @@ -490,7 +490,7 @@ //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId)); leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4))), --mCurrentRecordLong; - lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong)); + lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong)); } else { @@ -568,7 +568,7 @@ //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId)); leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4))); ++mCurrentRecordLong; - lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong)); + lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong)); } else { @@ -641,7 +641,7 @@ //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId)); leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4))); mCurrentRecordLong =mRecordCountLong; - lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong)); + lblRecordNo->setText(QString::number(mCurrentRecordLong) + tr(" of ") + QString::number(mRecordCountLong)); } else { @@ -710,7 +710,7 @@ leParameters->setText(""); //cboProjectionFamily->setCurrentItem(0); //cboEllipsoid->setCurrentItem(0); - lblRecordNo->setText("* of " + QString::number(mRecordCountLong)); + lblRecordNo->setText( tr("* of ") + QString::number(mRecordCountLong)); //remember the rec we are on in case the user aborts mLastRecordLong=mCurrentRecordLong; mCurrentRecordId=""; Index: src/gui/qgsoptions.cpp =================================================================== --- src/gui/qgsoptions.cpp (revision 6811) +++ src/gui/qgsoptions.cpp (working copy) @@ -239,7 +239,7 @@ #endif QString browser = QFileDialog::getOpenFileName( this, - "Choose a browser", + tr("Choose a browser"), "./", filter ); if(browser.length() > 0) Index: src/gui/qgssearchquerybuilder.cpp =================================================================== --- src/gui/qgssearchquerybuilder.cpp (revision 6811) +++ src/gui/qgssearchquerybuilder.cpp (working copy) @@ -31,7 +31,7 @@ { setupUi(this); - setWindowTitle("Search query builder"); + setWindowTitle(tr("Search query builder")); // disable unsupported operators btnIn->setEnabled(false); Index: src/gui/qgsmarkerdialog.cpp =================================================================== --- src/gui/qgsmarkerdialog.cpp (revision 6811) +++ src/gui/qgsmarkerdialog.cpp (working copy) @@ -68,7 +68,7 @@ void QgsMarkerDialog::changeDirectory() { QString newdir = QFileDialog::getExistingDirectory( - this, "Choose a directory", mCurrentDir); + this, tr("Choose a directory"), mCurrentDir); if (!newdir.isEmpty()) { mCurrentDir=newdir; Index: src/gui/qgsmaptoolcapture.cpp =================================================================== --- src/gui/qgsmaptoolcapture.cpp (revision 6811) +++ src/gui/qgsmaptoolcapture.cpp (working copy) @@ -78,14 +78,14 @@ if (!vlayer) { - QMessageBox::information(0,"Not a vector layer","The current layer is not a vector layer",QMessageBox::Ok); + QMessageBox::information(0, QObject::tr("Not a vector layer"), QObject::tr("The current layer is not a vector layer"),QMessageBox::Ok); return; } if (!vlayer->isEditable()) { - QMessageBox::information(0,"Layer not editable", - "Cannot edit the vector layer. To make it editable, go to the file item of the layer, right click and check 'Allow Editing'.", + QMessageBox::information(0,QObject::tr("Layer not editable"), + 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'."), QMessageBox::Ok); return; } @@ -98,8 +98,8 @@ //check we only use this tool for point/multipoint layers if(vlayer->vectorType() != QGis::Point) { - QMessageBox::information(0,"Wrong editing tool", "Cannot apply the 'capture point' tool on this vector layer",\ -QMessageBox::Ok); + QMessageBox::information(0, QObject::tr("Wrong editing tool"), QObject::tr("Cannot apply the 'capture point' tool on this vector layer"), + QMessageBox::Ok); return; } QgsPoint idPoint = toMapCoords(e->pos()); @@ -182,7 +182,7 @@ //check we only use the line tool for line/multiline layers if(mTool == CaptureLine && vlayer->vectorType() != QGis::Line) { - QMessageBox::information(0,"Wrong editing tool", "Cannot apply the 'capture line' tool on this vector layer",\ + QMessageBox::information(0,QObject::tr("Wrong editing tool"), QObject::tr("Cannot apply the 'capture line' tool on this vector layer"),\ QMessageBox::Ok); return; } @@ -190,7 +190,7 @@ //check we only use the polygon tool for polygon/multipolygon layers if(mTool == CapturePolygon && vlayer->vectorType() != QGis::Polygon) { - QMessageBox::information(0,"Wrong editing tool", "Cannot apply the 'capture polygon' tool on this vector layer",\ + QMessageBox::information(0,QObject::tr("Wrong editing tool"), QObject::tr("Cannot apply the 'capture polygon' tool on this vector layer"),\ QMessageBox::Ok); return; } Index: src/gui/qgsattributetabledisplay.cpp =================================================================== --- src/gui/qgsattributetabledisplay.cpp (revision 6811) +++ src/gui/qgsattributetabledisplay.cpp (working copy) @@ -133,7 +133,7 @@ { if(!table()->addAttribute(dialog.name(),dialog.type())) { - QMessageBox::information(0,"Name conflict","The attribute could not be inserted. The name already exists in the table",QMessageBox::Ok); + QMessageBox::information(0,tr("Name conflict"),tr("The attribute could not be inserted. The name already exists in the table"),QMessageBox::Ok); } } } @@ -182,12 +182,12 @@ if(table()->edited()) { //commit or roll back? - int commit=QMessageBox::information(0,"Stop editing","Do you want to save the changes?",QMessageBox::Yes,QMessageBox::No); + int commit=QMessageBox::information(0,tr("Stop editing"),tr("Do you want to save the changes?"),QMessageBox::Yes,QMessageBox::No); if(commit==QMessageBox::Yes) { if(!table()->commitChanges(mLayer)) { - QMessageBox::information(0,"Error","Could not commit changes",QMessageBox::Ok); + QMessageBox::information(0,tr("Error"),tr("Could not commit changes"),QMessageBox::Ok); } } else Index: src/gui/qgspgquerybuilder.cpp =================================================================== --- src/gui/qgspgquerybuilder.cpp (revision 6811) +++ src/gui/qgspgquerybuilder.cpp (working copy) @@ -212,7 +212,7 @@ }else { - QMessageBox::warning(this, tr("Database error"), tr("

Failed to get sample of field values using SQL:

") + sql + "

Error message was: "+ QString(PQerrorMessage(mPgConnection)) + "

"); + QMessageBox::warning(this, tr("Database error"), tr("

Failed to get sample of field values using SQL:

") + sql + tr("

Error message was: ")+ QString(PQerrorMessage(mPgConnection)) + "

"); } // free the result set PQclear(result); @@ -267,7 +267,7 @@ // if there is no sql, issue a warning if(txtSQL->text().isEmpty()) { - QMessageBox::information(this, "No Query", "You must create a query before you can test it"); + QMessageBox::information(this, tr("No Query"), tr("You must create a query before you can test it")); } else { @@ -334,7 +334,7 @@ if(numRecs == -1) { //error in query - show the problem - QMessageBox::warning(this,"Error in Query", mPgErrorMessage); + QMessageBox::warning(this,tr("Error in Query"), mPgErrorMessage); } else { Index: src/gui/qgsvectorlayerproperties.cpp =================================================================== --- src/gui/qgsvectorlayerproperties.cpp (revision 6811) +++ src/gui/qgsvectorlayerproperties.cpp (working copy) @@ -503,8 +503,8 @@ QgsDebug( cse.what() ); myMetadataQString += ""; - myMetadataQString += tr("In project spatial reference system units : "); - myMetadataQString += " (Invalid transformation of layer extents) "; + myMetadataQString += tr("In project spatial reference system units: "); + myMetadataQString += tr(" (Invalid transformation of layer extents) "); myMetadataQString += ""; } Index: src/gui/qgsspatialrefsys.cpp =================================================================== --- src/gui/qgsspatialrefsys.cpp (revision 6811) +++ src/gui/qgsspatialrefsys.cpp (working copy) @@ -1291,8 +1291,8 @@ // XXX This will likely never happen since on open, sqlite creates the // database if it does not exist. // ... unfortunately it happens on Windows - QMessageBox::warning(0,"Error","Could not open SRS database " - + path + "
Error(" + QString::number(myResult) + QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not open SRS database ") + + path + QObject::tr("
Error(") + QString::number(myResult) + "): " + QString(sqlite3_errmsg(*db)) ); } Index: src/gui/qgsgraduatedsymboldialog.cpp =================================================================== --- src/gui/qgsgraduatedsymboldialog.cpp (revision 6811) +++ src/gui/qgsgraduatedsymboldialog.cpp (working copy) @@ -62,8 +62,8 @@ return; } - modeComboBox->insertItem("Empty"); - modeComboBox->insertItem("Equal Interval"); + modeComboBox->insertItem( tr("Empty") ); + modeComboBox->insertItem( tr("Equal Interval") ); //restore the correct settings const QgsGraduatedSymbolRenderer* renderer = dynamic_cast < const QgsGraduatedSymbolRenderer * >(layer->renderer()); @@ -253,7 +253,7 @@ if (provider) { - if (modeComboBox->currentText() == "Equal Interval") + if (modeComboBox->currentText() == tr("Equal Interval") ) { minimum = provider->minValue(field).toDouble(); maximum = provider->maxValue(field).toDouble(); @@ -274,12 +274,12 @@ QPen pen; QBrush brush; - if (modeComboBox->currentText() == "Empty") + if (modeComboBox->currentText() == tr("Empty") ) { - listboxtext="Empty"+QString::number(i+1); + listboxtext= tr("Empty") + QString::number(i+1); mClassBreakBox->insertItem(listboxtext); } - else if(modeComboBox->currentText() == "Equal Interval") + else if(modeComboBox->currentText() == tr("Equal Interval") ) { double lower=minimum + (maximum - minimum) / numberofclassesspinbox->value() * i; double upper=minimum + (maximum - minimum) / numberofclassesspinbox->value() * (i+1); Index: src/gui/qgsmapserverexport.cpp =================================================================== --- src/gui/qgsmapserverexport.cpp (revision 6811) +++ src/gui/qgsmapserverexport.cpp (working copy) @@ -70,8 +70,8 @@ // Check for file and prompt for overwrite if it exists if (QFile::exists(txtMapFilePath->text())) { - okToSave = QMessageBox::warning(0, "Overwrite File?", txtMapFilePath->text() + - " exists. \nDo you want to overwrite it?", "Yes", "No"); + okToSave = QMessageBox::warning(0, tr("Overwrite File?"), txtMapFilePath->text() + + tr(" exists. \nDo you want to overwrite it?"), tr("Yes"), tr("No")); } if (okToSave == 0) { @@ -203,7 +203,7 @@ mapFile << " NAME " << name.toLocal8Bit().data() << std::endl; // feature type #ifdef QGISDEBUG - std::cout << "\tMapsrver Export checking feature type" << std::endl; + std::cout << "\tMapserver Export checking feature type" << std::endl; #endif mapFile << " TYPE "; switch (lyr->featureType()) @@ -231,7 +231,7 @@ mapFile << std::endl; #ifdef QGISDEBUG - std::cout << "\tMapsrver Export checking visibility" << std::endl; + std::cout << "\tMapserver Export checking visibility" << std::endl; #endif // set visibility (STATUS) mapFile << " STATUS "; @@ -247,7 +247,7 @@ // data source (DATA) // Data source spec depends on layer type #ifdef QGISDEBUG - std::cout << "\tMapsrver Export checking layer type" << std::endl; + std::cout << "\tMapserver Export checking layer type" << std::endl; #endif switch (lyr->type()) { @@ -301,14 +301,14 @@ //QListViewItem *li = map->getLegend()->currentItem(); // return li->text(0); #ifdef QGISDEBUG - std::cout << "\tMapsrver Export symbol name" << std::endl; + std::cout << "\tMapserver Export symbol name" << std::endl; #endif mapFile << " NAME \"" << lyr->name().toLocal8Bit().data() << "\"" << std::endl; mapFile << " # TEMPLATE" << std::endl; if (isPolygon) { #ifdef QGISDEBUG - std::cout << "\tMapsrver Export symbol fill color" << std::endl; + std::cout << "\tMapserver Export symbol fill color" << std::endl; #endif // use random fill colors // TODO Get fill color from the renderer @@ -322,7 +322,7 @@ mapFile << " COLOR " << red << " " << green << " " << blue << std::endl; } #ifdef QGISDEBUG - std::cout << "\tMapsrver Export checking for line symbol " << std::endl; + std::cout << "\tMapserver Export checking for line symbol " << std::endl; #endif if (isPolygon || isLine) { @@ -337,7 +337,7 @@ mapFile << " END" << std::endl; mapFile << "END" << std::endl; #ifdef QGISDEBUG - std::cout << "\tMapsrver Export layer definition done..." << std::endl; + std::cout << "\tMapserver Export layer definition done..." << std::endl; #endif } if (!chkExpLayersOnly->isChecked()) @@ -362,9 +362,9 @@ { QString s = QFileDialog::getSaveFileName( this, - "Choose a filename for the exported map file", + tr("Choose a filename for the exported map file"), "./", - "Mapserver files (*.map)" ); + tr("Mapserver files (*.map)" ) ); txtMapFilePath->setText(s); } @@ -373,6 +373,6 @@ //QMessageBox::information(this, "Help","Help"); QgsHelpViewer *hv = new QgsHelpViewer(this); // causes problems in qt3.1.x: hv->setModal(false); - hv->setCaption("QGIS Help - Mapserver Export"); + hv->setCaption( tr("QGIS Help - Mapserver Export") ); hv->show(); }