Skip to content

Commit

Permalink
Added i18n patch #666...
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6816 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Mar 18, 2007
1 parent 327ce8a commit d61480b
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsattributetabledisplay.cpp
Expand Up @@ -133,7 +133,7 @@ void QgsAttributeTableDisplay::addAttribute()
{
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);
}
}
}
Expand Down Expand Up @@ -182,12 +182,12 @@ void QgsAttributeTableDisplay::stopEditing()
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
Expand Down
10 changes: 5 additions & 5 deletions src/gui/qgscustomprojectiondialog.cpp
Expand Up @@ -414,7 +414,7 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
//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
{
Expand Down Expand Up @@ -490,7 +490,7 @@ void QgsCustomProjectionDialog::on_pbnPrevious_clicked()
//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
{
Expand Down Expand Up @@ -568,7 +568,7 @@ void QgsCustomProjectionDialog::on_pbnNext_clicked()
//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
{
Expand Down Expand Up @@ -641,7 +641,7 @@ void QgsCustomProjectionDialog::on_pbnLast_clicked()
//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
{
Expand Down Expand Up @@ -710,7 +710,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
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="";
Expand Down
12 changes: 6 additions & 6 deletions src/gui/qgsgraduatedsymboldialog.cpp
Expand Up @@ -62,8 +62,8 @@ QgsGraduatedSymbolDialog::QgsGraduatedSymbolDialog(QgsVectorLayer * layer): QDia
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());
Expand Down Expand Up @@ -253,7 +253,7 @@ void QgsGraduatedSymbolDialog::adjustClassification()

if (provider)
{
if (modeComboBox->currentText() == "Equal Interval")
if (modeComboBox->currentText() == tr("Equal Interval") )
{
minimum = provider->minValue(field).toDouble();
maximum = provider->maxValue(field).toDouble();
Expand All @@ -274,12 +274,12 @@ void QgsGraduatedSymbolDialog::adjustClassification()
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);
Expand Down
24 changes: 12 additions & 12 deletions src/gui/qgsmapserverexport.cpp
Expand Up @@ -70,8 +70,8 @@ bool QgsMapserverExport::write()
// 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)
{
Expand Down Expand Up @@ -203,7 +203,7 @@ void QgsMapserverExport::writeMapFile()
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())
Expand Down Expand Up @@ -231,7 +231,7 @@ void QgsMapserverExport::writeMapFile()
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 ";
Expand All @@ -247,7 +247,7 @@ void QgsMapserverExport::writeMapFile()
// 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())
{
Expand Down Expand Up @@ -301,14 +301,14 @@ void QgsMapserverExport::writeMapFile()
//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
Expand All @@ -322,7 +322,7 @@ void QgsMapserverExport::writeMapFile()
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)
{
Expand All @@ -337,7 +337,7 @@ void QgsMapserverExport::writeMapFile()
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())
Expand All @@ -362,9 +362,9 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
{
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);
}

Expand All @@ -373,6 +373,6 @@ void QgsMapserverExport::on_buttonHelp_clicked()
//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();
}
14 changes: 7 additions & 7 deletions src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -78,14 +78,14 @@ void QgsMapToolCapture::canvasReleaseEvent(QMouseEvent * e)

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;
}
Expand All @@ -98,8 +98,8 @@ void QgsMapToolCapture::canvasReleaseEvent(QMouseEvent * e)
//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());
Expand Down Expand Up @@ -182,15 +182,15 @@ QMessageBox::Ok);
//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;
}

//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;
}
Expand Down
20 changes: 10 additions & 10 deletions src/gui/qgsmaptoolvertexedit.cpp
Expand Up @@ -114,7 +114,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
//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;
Expand Down Expand Up @@ -159,7 +159,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
{
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;
Expand All @@ -169,7 +169,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
{
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;
Expand All @@ -178,7 +178,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
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;
Expand Down Expand Up @@ -227,7 +227,7 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
// 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;
Expand Down Expand Up @@ -395,22 +395,22 @@ void QgsMapToolVertexEdit::canvasReleaseEvent(QMouseEvent * e)

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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmarkerdialog.cpp
Expand Up @@ -68,7 +68,7 @@ QString QgsMarkerDialog::selectedMarker()
void QgsMarkerDialog::changeDirectory()
{
QString newdir = QFileDialog::getExistingDirectory(
this, "Choose a directory", mCurrentDir);
this, tr("Choose a directory"), mCurrentDir);
if (!newdir.isEmpty())
{
mCurrentDir=newdir;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsoptions.cpp
Expand Up @@ -239,7 +239,7 @@ void QgsOptions::on_btnFindBrowser_clicked()
#endif
QString browser = QFileDialog::getOpenFileName(
this,
"Choose a browser",
tr("Choose a browser"),
"./",
filter );
if(browser.length() > 0)
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgspgquerybuilder.cpp
Expand Up @@ -212,7 +212,7 @@ void QgsPgQueryBuilder::on_btnSampleValues_clicked()

}else
{
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>");
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>");
}
// free the result set
PQclear(result);
Expand Down Expand Up @@ -267,7 +267,7 @@ void QgsPgQueryBuilder::on_btnTest_clicked()
// 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
{
Expand Down Expand Up @@ -334,7 +334,7 @@ void QgsPgQueryBuilder::on_btnOk_clicked()
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
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgssearchquerybuilder.cpp
Expand Up @@ -31,7 +31,7 @@ QgsSearchQueryBuilder::QgsSearchQueryBuilder(QgsVectorLayer* layer,
{
setupUi(this);

setWindowTitle("Search query builder");
setWindowTitle(tr("Search query builder"));

// disable unsupported operators
btnIn->setEnabled(false);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsspatialrefsys.cpp
Expand Up @@ -1291,8 +1291,8 @@ int QgsSpatialRefSys::openDb(QString path, sqlite3 **db)
// 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 + "<br>Error(" + QString::number(myResult)
QMessageBox::warning(0, QObject::tr("Error"), QObject::tr("Could not open SRS database ")
+ path + QObject::tr("<br>Error(") + QString::number(myResult)
+ "): " + QString(sqlite3_errmsg(*db)) );

}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsvectorlayerproperties.cpp
Expand Up @@ -503,8 +503,8 @@ QString QgsVectorLayerProperties::getMetadata()
QgsDebug( cse.what() );

myMetadataQString += "<tr><td bgcolor=\"white\">";
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 += "</td></tr>";

}
Expand Down

0 comments on commit d61480b

Please sign in to comment.