Skip to content

Commit

Permalink
Add tr() to text that the user gets to see
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4756 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jan 27, 2006
1 parent 2e44dbc commit b881a33
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions src/plugins/geoprocessing/qgspggeoprocessing.cpp
Expand Up @@ -78,16 +78,16 @@ QgsPgGeoprocessing::~QgsPgGeoprocessing()
*/
void QgsPgGeoprocessing::initGui()
{
QMenu *pluginMenu = qI->getPluginMenu("&Geoprocessing");
menuId = pluginMenu->insertItem(QIcon(icon_buffer),"&Buffer Features", this, SLOT(buffer()));
QMenu *pluginMenu = qI->getPluginMenu(tr("&Geoprocessing"));
menuId = pluginMenu->insertItem(QIcon(icon_buffer),tr("&Buffer Features"), this, SLOT(buffer()));

pluginMenu->setWhatsThis(menuId, "Create a buffer for a PostgreSQL layer. "
"A new layer is created in the database with the buffered features.");
pluginMenu->setWhatsThis(menuId, tr("Create a buffer for a PostgreSQL layer. "
"A new layer is created in the database with the buffered features."));

// Create the action for tool
bufferAction = new QAction(QIcon(icon_buffer), "Buffer features", this);
bufferAction->setWhatsThis("Create a buffer for a PostgreSQL layer. "
"A new layer is created in the database with the buffered features.");
bufferAction = new QAction(QIcon(icon_buffer), tr("Buffer features"), this);
bufferAction->setWhatsThis(tr("Create a buffer for a PostgreSQL layer. "
"A new layer is created in the database with the buffered features."));
// Connect the action to the buffer slot
connect(bufferAction, SIGNAL(activated()), this, SLOT(buffer()));

Expand Down Expand Up @@ -339,14 +339,15 @@ void QgsPgGeoprocessing::buffer()
}
else
{
QMessageBox::critical(0, "Unable to add geometry column",
QString("Unable to add geometry column to the output table %1-%2")
.arg(bb->bufferLayerName()).arg(PQerrorMessage(conn)));
QMessageBox::critical(0, tr("Unable to add geometry column"),
QString(tr("Unable to add geometry column to the output table ") +
QString("%1-%2").arg(bb->bufferLayerName()).arg(PQerrorMessage(conn))));

}
} else {
QMessageBox::critical(0, "Unable to create table",
QString("Failed to create the output table %1").arg(bb->bufferLayerName()));
QMessageBox::critical(0, tr("Unable to create table"),
QString(tr("Failed to create the output table ") +
QString("%1").arg(bb->bufferLayerName())));
}
QApplication::restoreOverrideCursor();
}
Expand All @@ -357,16 +358,18 @@ void QgsPgGeoprocessing::buffer()
QMessageBox::critical(0, err, PQerrorMessage(conn));
}
}else{
QMessageBox::critical(0,"No GEOS support","Buffer function requires GEOS support in PostGIS");
QMessageBox::critical(0,tr("No GEOS support"),
tr("Buffer function requires GEOS support in PostGIS"));
}
} else {
QMessageBox::critical(0, "Not a PostgreSQL/PosGIS Layer",
QString
("%1 is not a PostgreSQL/PosGIS layer. Geoprocessing functions are only available for PostgreSQL/PosGIS Layers").
arg(lyr->name()));
QMessageBox::critical(0, tr("Not a PostgreSQL/PosGIS Layer"),
QString("%1").arg(lyr->name()) +
tr(" is not a PostgreSQL/PosGIS layer. Geoprocessing functions "
"are only available for PostgreSQL/PosGIS Layers"));
}
} else {
QMessageBox::warning(0, "No Active Layer", "You must select a layer in the legend to buffer");
QMessageBox::warning(0, tr("No Active Layer"),
tr("You must select a layer in the legend to buffer"));
}
}
/* Functions for determining available features in postGIS */
Expand Down Expand Up @@ -419,7 +422,7 @@ bool QgsPgGeoprocessing::hasPROJ(PGconn *connection){
void QgsPgGeoprocessing::unload()
{
// remove the GUI
qI->removePluginMenuItem("&Geoprocessing",menuId);
qI->removePluginMenuItem(tr("&Geoprocessing"),menuId);
qI->removeToolBarIcon(bufferAction);
delete bufferAction;
}
Expand Down

0 comments on commit b881a33

Please sign in to comment.