Index: src/plugins/grass/qgsgrassregion.cpp
===================================================================
--- src/plugins/grass/qgsgrassregion.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassregion.cpp (working copy)
@@ -194,15 +194,15 @@
QString mapset = QgsGrass::getDefaultMapset();
if ( gisdbase.isEmpty() || location.isEmpty() || mapset.isEmpty() ) {
- QMessageBox::warning( 0, "Warning", "GISDBASE, LOCATION_NAME or MAPSET is not set, "
- "cannot display current region." );
+ QMessageBox::warning( 0, tr("Warning"), tr("GISDBASE, LOCATION_NAME or MAPSET is not set, "
+ "cannot display current region." ) );
}
QgsGrass::setLocation ( gisdbase, location );
char *err = G__get_window ( &mWindow, "", "WIND", (char *) mapset.latin1() );
if ( err ) {
- QMessageBox::warning( 0, "Warning", "Cannot read current region: " + QString(err) );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot read current region: ") + QString(err) );
return;
}
@@ -461,7 +461,7 @@
G__setenv( "MAPSET", (char *) QgsGrass::getDefaultMapset().latin1() );
if ( G_put_window(&mWindow) == -1 ) {
- QMessageBox::warning( 0, "Warning", "Cannot write region" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot write region") );
return;
}
Index: src/plugins/grass/qgsgrassattributes.cpp
===================================================================
--- src/plugins/grass/qgsgrassattributes.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassattributes.cpp (working copy)
@@ -163,13 +163,13 @@
tb->setRowReadOnly ( 0, TRUE );
tb->setRowReadOnly ( 1, TRUE );
- tb->horizontalHeader()->setLabel( 0, "Column" );
- tb->horizontalHeader()->setLabel( 1, "Value" );
- tb->horizontalHeader()->setLabel( 2, "Type" ); // Internal use
+ tb->horizontalHeader()->setLabel( 0, tr("Column") );
+ tb->horizontalHeader()->setLabel( 1, tr("Value") );
+ tb->horizontalHeader()->setLabel( 2, tr("Type") ); // Internal use
tb->setLeftMargin(0); // hide row labels
- tb->setText ( 0, 0, "Field" );
+ tb->setText ( 0, 0, tr("Field") );
tb->setText ( 1, 0, "Cat" );
tabCats->addTab ( tb, label );
@@ -311,9 +311,9 @@
if ( !error->isEmpty() ) {
QMessageBox::warning( 0, tr("Warning"), *error );
- resultLabel->setText ( "ERROR" );
+ resultLabel->setText ( tr("ERROR") );
} else {
- resultLabel->setText ( "OK" );
+ resultLabel->setText ( tr("OK") );
}
delete error;
Index: src/plugins/grass/qgsgrassplugin.cpp
===================================================================
--- src/plugins/grass/qgsgrassplugin.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassplugin.cpp (working copy)
@@ -176,7 +176,7 @@
tr("Edit Current Grass Region"), this);
mEditAction = new QAction(QIcon(icon_grass_edit),
tr("Edit Grass Vector layer"), this);
- mNewVectorAction = new QAction(QIcon(icon_new_vector_layer),"Create new Grass Vector", this);
+ mNewVectorAction = new QAction(QIcon(icon_new_vector_layer),tr("Create new Grass Vector"), this);
mAddVectorAction->setWhatsThis(tr("Adds a GRASS vector layer to the map canvas"));
mAddRasterAction->setWhatsThis(tr("Adds a GRASS raster layer to the map canvas"));
@@ -441,7 +441,7 @@
void QgsGrassPlugin::edit()
{
if ( QgsGrassEdit::isRunning() ) {
- QMessageBox::warning( 0, "Warning", "GRASS Edit is already running." );
+ QMessageBox::warning( 0, tr("Warning"), tr("GRASS Edit is already running.") );
return;
}
@@ -483,7 +483,7 @@
#endif
if ( QgsGrassEdit::isRunning() ) {
- QMessageBox::warning( 0, "Warning", "GRASS Edit is already running." );
+ QMessageBox::warning( 0, tr("Warning"), tr("GRASS Edit is already running." ) );
return;
}
@@ -491,8 +491,8 @@
QString name;
QgsGrassElementDialog dialog;
- name = dialog.getItem ( "vector", "New vector name",
- "New vector name", "", "", &ok );
+ name = dialog.getItem ( "vector", tr("New vector name"),
+ tr("New vector name"), "", "", &ok );
if ( !ok ) return;
@@ -507,7 +507,7 @@
if ( QgsGrass::getError() == QgsGrass::FATAL )
{
- QMessageBox::warning( 0, "Warning", "Cannot create new vector: "
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot create new vector: ")
+ QgsGrass::getErrorMessage() );
return;
}
@@ -529,8 +529,8 @@
if ( !provider )
{
- QMessageBox::warning( 0, "Warning", "New vector created "
- "but cannot beopened by data provider." );
+ QMessageBox::warning( 0, tr("Warning"), tr("New vector created "
+ "but cannot be opened by data provider.") );
return;
}
@@ -542,12 +542,12 @@
ed->show();
mCanvas->refresh();
} else {
- QMessageBox::warning( 0, "Warning", "Cannot start editing." );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot start editing." ) );
delete ed;
}
/*
if ( !(mProvider->startEdit()) ) {
- QMessageBox::warning( 0, "Warning", "Cannot open vector for update." );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot open vector for update.") );
return;
}
*/
@@ -578,8 +578,8 @@
QString mapset = QgsGrass::getDefaultMapset();
if ( gisdbase.isEmpty() || location.isEmpty() || mapset.isEmpty() ) {
- QMessageBox::warning( 0, "Warning", "GISDBASE, LOCATION_NAME or MAPSET is not set, "
- "cannot display current region." );
+ QMessageBox::warning( 0, tr("Warning"), tr("GISDBASE, LOCATION_NAME or MAPSET is not set, "
+ "cannot display current region.") );
return;
}
@@ -589,7 +589,7 @@
char *err = G__get_window ( &window, "", "WIND", (char *) mapset.latin1() );
if ( err ) {
- QMessageBox::warning( 0, "Warning", "Cannot read current region: " + QString(err) );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot read current region: ") + QString(err) );
return;
}
@@ -694,7 +694,7 @@
if ( !err.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot open the mapset. " + err );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot open the mapset. ") + err );
return;
}
@@ -712,7 +712,7 @@
if ( !err.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot close mapset. " + err );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot close mapset. ") + err );
return;
}
@@ -768,8 +768,8 @@
QString err = QgsGrass::closeMapset ();
if ( !err.isNull() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot close current mapset. " + err );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot close current mapset. ") + err );
return;
}
mapsetChanged();
@@ -778,7 +778,7 @@
if ( !err.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot open GRASS mapset. " + err );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot open GRASS mapset. ") + err );
return;
}
Index: src/plugins/grass/qgsgrassutils.cpp
===================================================================
--- src/plugins/grass/qgsgrassutils.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassutils.cpp (working copy)
@@ -126,7 +126,7 @@
mErrorLabel->setMinimumHeight ( mErrorLabel->height()+5 );
mOkButton = new QPushButton ( );
- mCancelButton = new QPushButton ( "Cancel" );
+ mCancelButton = new QPushButton ( tr("Cancel" ) );
layout->insertLayout( -1, buttonLayout );
buttonLayout->addWidget( mOkButton );
@@ -157,12 +157,12 @@
QString text = mLineEdit->text().trimmed();
mErrorLabel->setText ( " " );
- mOkButton->setText ("Ok");
+ mOkButton->setText ( tr("Ok" ) );
mOkButton->setEnabled ( true );
if ( text.length() == 0 )
{
- mErrorLabel->setText ( "Enter a name!" );
+ mErrorLabel->setText ( tr( "Enter a name!" ) );
mOkButton->setEnabled ( false );
return;
}
@@ -173,14 +173,14 @@
if ( !mSource.isNull() && text == mSource )
#endif
{
- mErrorLabel->setText ( "This is name of the source!" );
+ mErrorLabel->setText ( tr( "This is name of the source!" ) );
mOkButton->setEnabled ( false );
return;
}
if ( QgsGrassUtils::itemExists( mElement, text ) )
{
- mErrorLabel->setText ( "Exists!" );
- mOkButton->setText ("Overwrite");
+ mErrorLabel->setText ( tr( "Exists!" ) );
+ mOkButton->setText ( tr("Overwrite") );
return;
}
}
Index: src/plugins/grass/qgsgrassnewmapset.cpp
===================================================================
--- src/plugins/grass/qgsgrassnewmapset.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassnewmapset.cpp (working copy)
@@ -101,12 +101,12 @@
setHelpEnabled ( page(MAPSET), false );
setHelpEnabled ( page(FINISH), false );
- setTitle ( page(DATABASE), "GRASS database" );
- setTitle ( page(LOCATION), "GRASS location" );
- setTitle ( page(PROJECTION), "Projection" );
- setTitle ( page(REGION), "Default GRASS Region" );
- setTitle ( page(MAPSET), "Mapset" );
- setTitle ( page(FINISH), "Create New Mapset" );
+ setTitle ( page(DATABASE), tr("GRASS database") );
+ setTitle ( page(LOCATION), tr("GRASS location") );
+ setTitle ( page(PROJECTION), tr("Projection") );
+ setTitle ( page(REGION), tr("Default GRASS Region") );
+ setTitle ( page(MAPSET), tr("Mapset") );
+ setTitle ( page(FINISH), tr("Create New Mapset") );
setError ( mDatabaseErrorLabel, "" );
setError ( mLocationErrorLabel, "" );
@@ -135,34 +135,34 @@
// Create example tree structure
mTreeListView->clear();
mTreeListView->setSortColumn(-1); // No sorting
- mTreeListView->setColumnText( 0, "Tree" );
- mTreeListView->addColumn( "Comment" );
- Q3ListViewItem *dbi = new Q3ListViewItem( mTreeListView, "OurDatabase", "Database" );
+ mTreeListView->setColumnText( 0, tr("Tree") );
+ mTreeListView->addColumn( tr("Comment") );
+ Q3ListViewItem *dbi = new Q3ListViewItem( mTreeListView, "OurDatabase", tr("Database") );
dbi->setOpen(true);
// First inserted is last in the view
- Q3ListViewItem *l = new Q3ListViewItem( dbi, "New Zealand", "Location 2" );
+ Q3ListViewItem *l = new Q3ListViewItem( dbi, "New Zealand", tr("Location 2") );
l->setOpen(true);
- Q3ListViewItem *m = new Q3ListViewItem( l, "Cimrman", "User's mapset");
+ Q3ListViewItem *m = new Q3ListViewItem( l, "Cimrman", tr("User's mapset") );
m->setOpen(true);
- m = new Q3ListViewItem( l, "PERMANENT", "System mapset" );
+ m = new Q3ListViewItem( l, "PERMANENT", tr("System mapset") );
m->setOpen(true);
- l = new Q3ListViewItem( dbi, "Mexico", "Location 1" );
+ l = new Q3ListViewItem( dbi, "Mexico", tr("Location 1") );
m->setOpen(true);
- m = new Q3ListViewItem( l, "Juan", "User's mapset");
+ m = new Q3ListViewItem( l, "Juan", tr("User's mapset") );
l->setOpen(true);
- m = new Q3ListViewItem( l, "Alejandra", "User's mapset");
+ m = new Q3ListViewItem( l, "Alejandra", tr("User's mapset") );
m->setOpen(true);
- m = new Q3ListViewItem( l, "PERMANENT", "System mapset" );
+ m = new Q3ListViewItem( l, "PERMANENT", tr("System mapset") );
m->setOpen(true);
// PROJECTION
// MAPSET
mMapsetsListView->clear();
- mMapsetsListView->setColumnText( 0, "Mapset" );
- mMapsetsListView->addColumn( "Owner" );
+ mMapsetsListView->setColumnText( 0, tr("Mapset") );
+ mMapsetsListView->addColumn( tr("Owner") );
// FINISH
setFinishEnabled ( page(FINISH), true );
@@ -211,7 +211,7 @@
if ( database.length() == 0 )
{
- setError ( mDatabaseErrorLabel, "Enter path to GRASS database");
+ setError ( mDatabaseErrorLabel, tr("Enter path to GRASS database") );
return;
}
@@ -219,7 +219,7 @@
if ( !databaseInfo.exists() )
{
- setError ( mDatabaseErrorLabel, "The directory doesn't exist!");
+ setError ( mDatabaseErrorLabel, tr("The directory doesn't exist!") );
return;
}
@@ -248,8 +248,8 @@
}
else
{
- setError ( mDatabaseErrorLabel, "No writable "
- "locations, the database not writable!");
+ setError ( mDatabaseErrorLabel, tr("No writable "
+ "locations, the database not writable!") );
}
}
@@ -347,7 +347,7 @@
if ( location.length() == 0 )
{
setNextEnabled ( page(LOCATION), false );
- setError ( mLocationErrorLabel, "Enter location name!");
+ setError ( mLocationErrorLabel, tr("Enter location name!") );
}
else
{
@@ -360,7 +360,7 @@
if ( d[i] == location )
{
setNextEnabled ( page(LOCATION), false );
- setError ( mLocationErrorLabel, "The location exists!");
+ setError ( mLocationErrorLabel, tr("The location exists!") );
break;
}
}
@@ -508,7 +508,7 @@
if ( !mProjInfo || !mProjUnits )
{
- setError ( mProjErrorLabel, "Selected projection is not supported by GRASS!");
+ setError ( mProjErrorLabel, tr("Selected projection is not supported by GRASS!") );
}
}
else // Nothing selected
@@ -554,8 +554,8 @@
newSrs.createFromSrsId ( mProjectionSelector->getCurrentSRSID() );
if ( ! newSrs.isValid() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot create projection." );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot create projection.") );
}
}
}
@@ -602,8 +602,8 @@
}
else
{
- QMessageBox::warning( 0, "Warning", "Cannot reproject "
- "previously set region, default region set." );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot reproject "
+ "previously set region, default region set." ) );
setGrassRegionDefaults();
}
@@ -738,12 +738,12 @@
if ( n <= s )
{
- setError ( mRegionErrorLabel, "North must be greater than south");
+ setError ( mRegionErrorLabel, tr("North must be greater than south") );
err = true;
}
if ( e <= w && mCellHead.proj != PROJECTION_LL )
{
- setError ( mRegionErrorLabel, "East must be greater than west");
+ setError ( mRegionErrorLabel, tr("East must be greater than west") );
err = true;
}
@@ -795,13 +795,13 @@
QFile file ( path );
if ( !file.exists() ) {
- QMessageBox::warning( 0, "Warning",
- "Regions file (" + path + ") not found." );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Regions file (") + path + tr(") not found.") );
return;
}
if ( ! file.open( QIODevice::ReadOnly ) ) {
- QMessageBox::warning( 0, "Warning",
- "Cannot open locations file (" + path +")" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot open locations file (") + path +tr(")") );
return;
}
@@ -810,11 +810,11 @@
int line, column;
if ( !doc.setContent( &file, &err, &line, &column ) ) {
- QString errmsg = "Cannot read locations file (" + path + "):\n"
- + err + "\nat line " + QString::number(line)
- + " column " + QString::number(column);
+ QString errmsg = tr("Cannot read locations file (") + path + tr("):\n")
+ + err + tr("\nat line ") + QString::number(line)
+ + tr(" column ") + QString::number(column);
std::cerr << errmsg.toLocal8Bit().data() << std::endl;
- QMessageBox::warning( 0, "Warning", errmsg );
+ QMessageBox::warning( 0, tr("Warning"), errmsg );
file.close();
return;
}
@@ -906,8 +906,8 @@
if ( !source.isValid() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot create QgsSpatialRefSys" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot create QgsSpatialRefSys" ) );
return;
}
@@ -916,8 +916,8 @@
if ( !dest.isValid() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot create QgsSpatialRefSys" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot create QgsSpatialRefSys") );
return;
}
@@ -946,8 +946,8 @@
if ( !ok )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot reproject selected region." );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr( "Cannot reproject selected region.") );
return;
}
}
@@ -1035,7 +1035,7 @@
if ( !ok )
{
- QMessageBox::warning( 0, "Warning", "Cannot reproject region" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot reproject region") );
return;
}
}
@@ -1129,8 +1129,8 @@
if ( !source.isValid() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot create QgsSpatialRefSys" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot create QgsSpatialRefSys") );
return;
}
@@ -1138,8 +1138,8 @@
if ( !dest.isValid() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot create QgsSpatialRefSys" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot create QgsSpatialRefSys") );
return;
}
@@ -1266,7 +1266,7 @@
// TODO?: Check spaces in the name
if ( mapset.length() == 0 )
{
- setError ( mMapsetErrorLabel, "Enter mapset name.");
+ setError ( mMapsetErrorLabel, tr("Enter mapset name."));
return;
}
@@ -1283,7 +1283,7 @@
if ( d[i] == mapset )
{
- setError ( mMapsetErrorLabel, "The mapset already exists");
+ setError ( mMapsetErrorLabel, tr("The mapset already exists") );
exists = true;
break;
}
@@ -1307,7 +1307,7 @@
std::cerr << "QgsGrassNewMapset::setFinish()" << std::endl;
#endif
- mDatabaseLabel->setText ( "Database: " + mDatabaseLineEdit->text() );
+ mDatabaseLabel->setText ( tr("Database: ") + mDatabaseLineEdit->text() );
QString location;
if ( mSelectLocationRadioButton->isChecked() )
@@ -1318,9 +1318,9 @@
{
location = mLocationLineEdit->text().stripWhiteSpace();
}
- mLocationLabel->setText ( "Location: " + location );
+ mLocationLabel->setText ( tr("Location: ") + location );
- mMapsetLabel->setText ( "Mapset: " + mMapsetLineEdit->text() );
+ mMapsetLabel->setText ( tr("Mapset: ") + mMapsetLineEdit->text() );
setFinishEnabled ( page(FINISH), true );
}
@@ -1351,8 +1351,8 @@
if ( ret != 0 )
{
- QMessageBox::warning (this, "Create location",
- "Cannot create new location: "
+ QMessageBox::warning (this, tr("Create location"),
+ tr("Cannot create new location: ")
+ QgsGrass::getErrorMessage() );
return;
@@ -1382,8 +1382,8 @@
if ( !d.mkdir(mapset) )
{
- QMessageBox::warning (this, "Create mapset",
- "Cannot create new mapset dircetory" );
+ QMessageBox::warning (this, tr("Create mapset"),
+ tr("Cannot create new mapset dircetory") );
return;
}
@@ -1393,14 +1393,14 @@
QFile in ( locationPath + "/PERMANENT/DEFAULT_WIND" );
if ( !in.open( QIODevice::ReadOnly ) )
{
- QMessageBox::warning (this, "Create mapset", "Cannot open DEFAULT_WIND" );
+ QMessageBox::warning (this, tr("Create mapset"), tr("Cannot open DEFAULT_WIND") );
return;
}
QFile out ( locationPath + "/" + mapset + "/WIND" );
if ( !out.open( QIODevice::WriteOnly ) )
{
- QMessageBox::warning (this, "Create mapset", "Cannot open WIND" );
+ QMessageBox::warning (this, tr("Create mapset"), tr("Cannot open WIND") );
return;
}
QTextStream stream ( &out );
@@ -1421,15 +1421,15 @@
if ( err.length() > 0 )
{
- QMessageBox::information ( this, "New mapset",
- "New mapset successfully created, but cannot be "
- "opened: " + err );
+ QMessageBox::information ( this, tr("New mapset"),
+ tr("New mapset successfully created, but cannot be "
+ "opened: ") + err );
}
else
{
- QMessageBox::information ( this, "New mapset",
- "New mapset successfully created and set "
- "as current working mapset." );
+ QMessageBox::information ( this, tr("New mapset"),
+ tr("New mapset successfully created and set "
+ "as current working mapset.") );
mPlugin->mapsetChanged();
}
Index: src/plugins/grass/qgsgrassbrowser.cpp
===================================================================
--- src/plugins/grass/qgsgrassbrowser.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassbrowser.cpp (working copy)
@@ -269,8 +269,8 @@
{
suggest = map;
}
- QString newName = ed.getItem ( element, "New name",
- "New name", suggest, source, &ok );
+ QString newName = ed.getItem ( element, tr("New name"),
+ tr("New name"), suggest, source, &ok );
if ( !ok ) return;
@@ -335,8 +335,8 @@
QgsGrassElementDialog ed;
bool ok;
- QString newName = ed.getItem ( element, "New name",
- "New name", "", map, &ok );
+ QString newName = ed.getItem ( element, tr("New name"),
+ tr("New name"), "", map, &ok );
if ( !ok ) return;
Index: src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- src/plugins/grass/qgsgrassmodule.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassmodule.cpp (working copy)
@@ -212,21 +212,21 @@
QString mpath = mPath + ".qgm";
QFile qFile ( mpath );
if ( !qFile.exists() ) {
- QMessageBox::warning( 0, "Warning", "The module file (" + mpath + ") not found." );
+ QMessageBox::warning( 0, tr("Warning"), tr("The module file (") + mpath + tr(") not found.") );
return;
}
if ( ! qFile.open( QIODevice::ReadOnly ) ) {
- QMessageBox::warning( 0, "Warning", "Cannot open module file (" + mpath + ")" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot open module file (") + mpath + tr(")") );
return;
}
QDomDocument qDoc ( "qgisgrassmodule" );
QString err;
int line, column;
if ( !qDoc.setContent( &qFile, &err, &line, &column ) ) {
- QString errmsg = "Cannot read module file (" + mpath + "):\n" + err + "\nat line "
+ QString errmsg = tr("Cannot read module file (") + mpath + tr("):\n") + err + tr("\nat line ")
+ QString::number(line) + " column " + QString::number(column);
std::cerr << errmsg.toLocal8Bit().data() << std::endl;
- QMessageBox::warning( 0, "Warning", errmsg );
+ QMessageBox::warning( 0, tr("Warning"), errmsg );
qFile.close();
return;
}
@@ -252,7 +252,7 @@
else
{
std::cerr << "Module " << xName.ascii() << " not found" << std::endl;
- QMessageBox::warning( 0, "Warning", "Module " + xName + " not found" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Module ") + xName + tr(" not found") );
return;
}
#else
@@ -295,7 +295,7 @@
}
else
{
- QMessageBox::warning( 0, "Warning", "Cannot find man page " + manPath );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find man page ") + manPath );
}
connect ( &mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStdout()));
@@ -367,7 +367,7 @@
if ( arguments.size() == 0 )
{
- QMessageBox::warning( 0, "Warning", "Cannot find module "
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find module ")
+ mXName );
return;
}
@@ -385,7 +385,7 @@
|| (process.exitCode() != 0 && process.exitCode() != 255) )
{
std::cerr << "process.exitCode() = " << process.exitCode() << std::endl;
- QMessageBox::warning( 0, "Warning", "Cannot start module " + mXName + "
"
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot start module ") + mXName + "
"
+ cmd + " " + arguments.join(" ") + "
"
+ QString(process.readAllStandardOutput()) + "
"
+ QString(process.readAllStandardError()) );
@@ -398,12 +398,12 @@
QString err;
int line, column;
if ( !gDoc.setContent( (QByteArray)gDescArray, &err, &line, &column ) ) {
- QString errmsg = "Cannot read module description (" + mXName + "):\n" + err + "\nat line "
- + QString::number(line) + " column " + QString::number(column);
+ QString errmsg = tr("Cannot read module description (") + mXName + tr("):\n") + err + tr("\nat line ")
+ + QString::number(line) + tr(" column ") + QString::number(column);
std::cerr << errmsg.toLocal8Bit().data() << std::endl;
std::cerr << QString(gDescArray).local8Bit().data() << std::endl;
std::cerr << QString(errArray).local8Bit().data() << std::endl;
- QMessageBox::warning( 0, "Warning", errmsg );
+ QMessageBox::warning( 0, tr("Warning"), errmsg );
return;
}
QDomElement gDocElem = gDoc.documentElement();
@@ -423,7 +423,7 @@
QDomNode gnode = QgsGrassModule::nodeByKey ( gDocElem, key );
if ( gnode.isNull() ) {
- QMessageBox::warning( 0, "Warning", "Cannot find key " + key );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find key ") + key );
return;
}
@@ -562,7 +562,7 @@
}
}
- QMessageBox::warning( 0, "Warning", "Item with id " + id + " not found" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Item with id ") + id + tr(" not found" ) );
return 0;
}
@@ -805,7 +805,7 @@
QgsGrass::getDefaultLocation(),
QgsGrass::getDefaultMapset(), ¤tWindow ) )
{
- QMessageBox::warning( 0, "Warning", "Cannot get current region" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot get current region") );
return list;
}
@@ -839,8 +839,8 @@
QgsGrass::getDefaultLocation(), mapset, map,
&window ) )
{
- QMessageBox::warning( 0, "Warning", "Cannot check region "
- "of map " + item->currentMap() );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot check region "
+ "of map ") + item->currentMap() );
continue;
}
@@ -865,7 +865,7 @@
QgsGrass::getDefaultLocation(),
QgsGrass::getDefaultMapset(), window ) )
{
- QMessageBox::warning( 0, "Warning", "Cannot get current region" );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot get current region" ) );
return false;
}
@@ -903,8 +903,8 @@
QgsGrass::getDefaultLocation(), mapset, map,
&mapWindow ) )
{
- QMessageBox::warning( 0, "Warning", "Cannot set region "
- "of map " + item->currentMap() );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot set region "
+ "of map ") + item->currentMap() );
return false;
}
@@ -1001,21 +1001,21 @@
path.append ( ".qgm" );
QFile qFile ( path );
if ( !qFile.exists() ) {
- return QString ( "Not available, decription not found (" + path + ")" );
+ return QString ( tr("Not available, decription not found (") + path + tr(")") );
}
if ( ! qFile.open( QIODevice::ReadOnly ) ) {
- return QString ( "Not available, cannot open description (" + path + ")" ) ;
+ return QString ( tr("Not available, cannot open description (") + path + tr(")") ) ;
}
QDomDocument qDoc ( "qgisgrassmodule" );
QString err;
int line, column;
if ( !qDoc.setContent( &qFile, &err, &line, &column ) ) {
- QString errmsg = "Cannot read module file (" + path + "):\n" + err + "\nat line "
- + QString::number(line) + " column " + QString::number(column);
+ QString errmsg = tr("Cannot read module file (") + path + tr("):\n") + err + tr("\nat line ")
+ + QString::number(line) + tr(" column ") + QString::number(column);
std::cerr << errmsg.toLocal8Bit().data() << std::endl;
- QMessageBox::warning( 0, "Warning", errmsg );
+ QMessageBox::warning( 0, tr("Warning"), errmsg );
qFile.close();
- return QString ( "Not available, incorrect description (" + path + ")" );
+ return QString ( tr("Not available, incorrect description (") + path + tr(")") );
}
qFile.close();
QDomElement qDocElem = qDoc.documentElement();
@@ -1167,7 +1167,7 @@
{
err.append ( readyErrors.at(i) + "
" );
}
- QMessageBox::warning ( 0, "Warning", err );
+ QMessageBox::warning ( 0, tr("Warning"), err );
return;
}
@@ -1178,7 +1178,7 @@
{
if ( !mOptions->inputRegion ( &tempWindow, false ) )
{
- QMessageBox::warning ( 0, "Warning", "Cannot get input region" );
+ QMessageBox::warning ( 0, tr("Warning"), tr("Cannot get input region") );
return;
}
resetRegion = true;
@@ -1190,20 +1190,20 @@
{
if ( QgsGrass::versionMajor() >= 6 && QgsGrass::versionMinor() >= 1 )
{
- int ret = QMessageBox::question ( 0, "Warning",
- "Input " + outsideRegion.join(",")
- + " outside current region!",
- "Use input region", "Continue", "Cancel" );
+ int ret = QMessageBox::question ( 0, tr("Warning"),
+ tr("Input ") + outsideRegion.join(",")
+ + tr(" outside current region!"),
+ tr("Use input region"), tr("Continue"), tr("Cancel") );
if ( ret == 2 ) return;
if ( ret == 0 ) resetRegion = true;
}
else
{
- int ret = QMessageBox::question ( 0, "Warning",
- "Input " + outsideRegion.join(",")
- + " outside current region!",
- "Continue", "Cancel" );
+ int ret = QMessageBox::question ( 0, tr("Warning"),
+ tr("Input ") + outsideRegion.join(",")
+ + tr(" outside current region!"),
+ tr("Continue"), tr("Cancel") );
if ( ret == 1 ) return;
}
@@ -1212,8 +1212,8 @@
{
if ( !mOptions->inputRegion ( &tempWindow, true ) )
{
- QMessageBox::warning ( 0, "Warning",
- "Cannot get input region" );
+ QMessageBox::warning ( 0, tr("Warning"),
+ tr("Cannot get input region" ) );
return;
}
}
@@ -1224,9 +1224,9 @@
QStringList outputExists = mOptions->checkOutput();
if ( outputExists.size() > 0 )
{
- int ret = QMessageBox::question ( 0, "Warning",
- "Output " + outputExists.join(",")
- + " exists! Overwrite?",
+ int ret = QMessageBox::question ( 0, tr("Warning"),
+ tr("Output ") + outputExists.join(",")
+ + tr(" exists! Overwrite?"),
QMessageBox::Yes, QMessageBox::No );
if ( ret == QMessageBox::No ) return;
@@ -1314,7 +1314,7 @@
if ( execArguments.size() == 0 )
{
- QMessageBox::warning( 0, "Warning", "Cannot find module "
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find module ")
+ mXName );
return;
}
@@ -1386,7 +1386,7 @@
mProcess.waitForStarted();
if ( mProcess.state() != QProcess::Running )
{
- QMessageBox::warning( 0, "Warning", "Cannot start module: "
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot start module: ")
+ mProcess.errorString() );
return;
}
@@ -1405,16 +1405,16 @@
std::cerr << "exitCode = " << exitCode << std::endl;
if ( exitStatus == QProcess::NormalExit ) {
if ( exitCode == 0 ) {
- mOutputTextBrowser->append( "Successfully finished" );
+ mOutputTextBrowser->append( tr("Successfully finished") );
mProgressBar->setProgress ( 100, 100 );
mSuccess = true;
mViewButton->setEnabled(true);
mOptions->thawOutput();
} else {
- mOutputTextBrowser->append( "Finished with error" );
+ mOutputTextBrowser->append( tr("Finished with error") );
}
} else {
- mOutputTextBrowser->append( "Module crashed or killed" );
+ mOutputTextBrowser->append( tr("Module crashed or killed") );
}
mRunButton->setText( tr("Run") );
}
@@ -1953,7 +1953,7 @@
{
if ( mLineEdits.at(0)->text().trimmed().length() == 0 )
{
- error.append ( title() + ": missing value" );
+ error.append ( title() + tr(": missing value") );
}
}
return error;
@@ -2041,7 +2041,7 @@
if ( optNode.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot find typeoption " + opt );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find typeoption ") + opt );
}
else
{
@@ -2050,7 +2050,7 @@
QDomNode valuesNode = optNode.namedItem ( "values" );
if ( valuesNode.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot find values for typeoption " + opt );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find values for typeoption ") + opt );
}
else
{
@@ -2111,7 +2111,7 @@
if ( optNode.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot find layeroption " + opt );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find layeroption ") + opt );
}
else
{
@@ -2128,7 +2128,7 @@
}
else
{
- QMessageBox::warning( 0, "Warning", "GRASS element " + element + " not supported" );
+ QMessageBox::warning( 0, tr("Warning"), tr("GRASS element ") + element + tr(" not supported") );
}
if ( qdesc.attribute("update") == "yes" ) {
@@ -2152,7 +2152,7 @@
mRegionButton = new QPushButton(
QIcon(iconPath+"grass_set_region.png"), "" );
- mRegionButton->setToolTip ( "Use region of this map" );
+ mRegionButton->setToolTip ( tr("Use region of this map") );
mRegionButton->setCheckable ( true );
mRegionButton->setSizePolicy (QSizePolicy::Minimum,
QSizePolicy:: Preferred );
@@ -2480,7 +2480,7 @@
std::cerr << "count = " << mLayerComboBox->count() << std::endl;
if ( mLayerComboBox->count() == 0 )
{
- error.append ( title() + ": no input" );
+ error.append ( title() + tr(": no input") );
}
return error;
}
@@ -2576,7 +2576,7 @@
if ( optNode.isNull() )
{
- QMessageBox::warning( 0, "Warning", "Cannot find layeroption " + opt );
+ QMessageBox::warning( 0, tr("Warning"), tr("Cannot find layeroption ") + opt );
}
else
{
@@ -2698,11 +2698,11 @@
// -> layer -> PostGIS -> warning
if ( mOgrLayers[current].length() > 0 )
{
- QMessageBox::warning( 0, "Warning",
- "PostGIS driver in OGR does not support schemas!
"
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("PostGIS driver in OGR does not support schemas!
"
"Only the table name will be used.
"
"It can result in wrong input if more tables of the same name
"
- "are present in the database." );
+ "are present in the database.") );
}
}
@@ -2723,7 +2723,7 @@
std::cerr << "count = " << mLayerComboBox->count() << std::endl;
if ( mLayerComboBox->count() == 0 )
{
- error.append ( title() + ": no input" );
+ error.append ( title() + tr(": no input" ) );
}
return error;
}
@@ -2745,7 +2745,7 @@
QString tit;
if ( mDescription.isEmpty() )
{
- tit = "Attribute field";
+ tit = tr("Attribute field");
}
else
{
@@ -2835,7 +2835,7 @@
QString tit;
if ( mDescription.isEmpty() )
{
- tit = "Attribute field";
+ tit = tr("Attribute field");
}
else
{
@@ -2945,7 +2945,7 @@
QString tit;
if ( mDescription.isEmpty() )
{
- tit = "File";
+ tit = tr("File");
}
else
{
@@ -3060,14 +3060,14 @@
if ( path.length() == 0 )
{
- error.append ( title() + ": missing value" );
+ error.append ( title() + tr(": missing value") );
return error;
}
QFileInfo fi(path);
if ( !fi.dir().exists() )
{
- error.append ( title() + ": directory does not exist" );
+ error.append ( title() + tr(": directory does not exist") );
}
return error;
Index: src/plugins/grass/qgsgrassmapcalc.cpp
===================================================================
--- src/plugins/grass/qgsgrassmapcalc.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassmapcalc.cpp (working copy)
@@ -239,7 +239,7 @@
// Add output object
mOutput = new QgsGrassMapcalcObject( QgsGrassMapcalcObject::Output);
mOutput->setId ( nextId() );
- mOutput->setValue ( "Output" );
+ mOutput->setValue ( tr("Output") );
mOutput->setCanvas(mCanvas);
mOutput->setCenter ( (int)(mCanvas->width()-mOutput->width()), (int)(mCanvas->height()/2) ),
mCanvas->update();
@@ -1385,7 +1385,7 @@
}
case QgsGrassMapcalcObject::Output :
- obj->setValue ( "Output" );
+ obj->setValue ( tr("Output") );
mOutput = obj;
break;
Index: src/plugins/grass/qgsgrassmodel.cpp
===================================================================
--- src/plugins/grass/qgsgrassmodel.cpp (revision 6856)
+++ src/plugins/grass/qgsgrassmodel.cpp (working copy)
@@ -131,19 +131,19 @@
switch ( mType )
{
case QgsGrassModel::Location:
- return "Location: " + mLocation;
+ return QObject::tr("Location: ","Metadata in GRASS Browser") + mLocation;
break;
case QgsGrassModel::Mapset:
- return "Location: " + mLocation + "
Mapset: " + mMapset;
+ return QObject::tr("Location: ","Metadata in GRASS Browser") + mLocation + QObject::tr("
Mapset: ","Metadata in GRASS Browser") + mMapset;
break;
case QgsGrassModel::Vectors:
case QgsGrassModel::Rasters:
- return "Location: " + mLocation + "
Mapset: " + mMapset;
+ return QObject::tr("Location: ") + mLocation + QObject::tr("
Mapset: ") + mMapset;
break;
case QgsGrassModel::Raster:
{
QString str = tblStart;
- str += htmlTableRow("Raster", "" + mMap + "" );
+ str += htmlTableRow(QObject::tr("Raster"), "" + mMap + "" );
struct Cell_head head;
int rasterType = -1;
@@ -152,18 +152,18 @@
if( G_get_cellhd( mMap.toLocal8Bit().data(),
mMapset.toLocal8Bit().data(), &head) != 0 )
{
- str += "
History
";
+ str += "
"+ QObject::tr("History
");
QRegExp rx ( "^-+$" );
while ( Vect_hist_read ( hbuffer, 1000, &Map ) != NULL ) {
QString row = QString(hbuffer);
@@ -344,8 +344,8 @@
case QgsGrassModel::VectorLayer:
{
QString str = tblStart;
- str += htmlTableRow("Vector", "" + mMap + "" );
- str += htmlTableRow("Layer", "" + mLayer + "" );
+ str += htmlTableRow(QObject::tr("Vector"), "" + mMap + "" );
+ str += htmlTableRow(QObject::tr("Layer"), "" + mLayer + "" );
QgsGrass::setLocation( mGisbase, mLocation );
@@ -364,7 +364,7 @@
int type = QgsGrassProvider::grassLayerType(mLayer);
if (type != -1 )
{
- str += htmlTableRow("Features",
+ str += htmlTableRow( QObject::tr("Features"),
QString::number(Vect_cidx_get_type_count(&Map, field, type)) );
}
@@ -373,10 +373,10 @@
// Database link
if ( fi )
{
- str += htmlTableRow("Driver", QString(fi->driver) );
- str += htmlTableRow("Database", QString(fi->database) );
- str += htmlTableRow("Table", QString(fi->table) );
- str += htmlTableRow("Key column", QString(fi->key) );
+ str += htmlTableRow(QObject::tr("Driver"), QString(fi->driver) );
+ str += htmlTableRow(QObject::tr("Database"), QString(fi->database) );
+ str += htmlTableRow(QObject::tr("Table"), QString(fi->table) );
+ str += htmlTableRow(QObject::tr("Key column"), QString(fi->key) );
}
}
}
Index: src/plugins/grass/qgsgrasstools.cpp
===================================================================
--- src/plugins/grass/qgsgrasstools.cpp (revision 6856)
+++ src/plugins/grass/qgsgrasstools.cpp (working copy)
@@ -102,7 +102,7 @@
std::cerr << "QgsGrassTools()" << std::endl;
#endif
- setWindowTitle ( "GRASS Tools" );
+ setWindowTitle ( tr("GRASS Tools") );
// setupUi(this);
mQgisApp = qgisApp;
@@ -132,7 +132,7 @@
connect( mModulesListView, SIGNAL(clicked(Q3ListViewItem *)),
this, SLOT(moduleClicked( Q3ListViewItem *)) );
- QString title = "GRASS Tools: " + QgsGrass::getDefaultLocation()
+ QString title = tr("GRASS Tools: ") + QgsGrass::getDefaultLocation()
+ "/" + QgsGrass::getDefaultMapset();
setCaption(title);
@@ -219,8 +219,8 @@
if ( !file.exists() )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot find MSYS (" + msysPath + ")" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot find MSYS (") + msysPath + ")" );
}
else
{
@@ -231,8 +231,8 @@
proc->waitForStarted();
if ( proc->state() != QProcess::Running )
{
- QMessageBox::warning( 0, "Warning",
- "Cannot start MSYS (" + msysPath + ")" );
+ QMessageBox::warning( 0, tr("Warning"),
+ tr("Cannot start MSYS (") + msysPath + ")" );
}
}
return;
@@ -242,7 +242,7 @@
sh = new QgsGrassShell(this, mTabWidget);
m = dynamic_cast