Skip to content

Commit 65a41b7

Browse files
author
g_j_m
committedApr 6, 2006
Apply patch from ticket #44
git-svn-id: http://svn.osgeo.org/qgis/trunk@5185 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 768c876 commit 65a41b7

File tree

11 files changed

+114
-114
lines changed

11 files changed

+114
-114
lines changed
 

‎src/gui/qgisapp.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ static void setTitleBarText_( QWidget & qgisApp )
216216
{
217217

218218
setupUi(this);
219-
mSplash->showMessage("Reading settings", Qt::AlignHCenter | Qt::AlignBottom);
219+
mSplash->showMessage(tr("Reading settings"), Qt::AlignHCenter | Qt::AlignBottom);
220220
qApp->processEvents();
221221
readSettings();
222-
mSplash->showMessage("Setting up the GUI", Qt::AlignHCenter | Qt::AlignBottom);
222+
mSplash->showMessage(tr("Setting up the GUI"), Qt::AlignHCenter | Qt::AlignBottom);
223223
qApp->processEvents();
224224
createActions();
225225
createActionGroups();
@@ -234,7 +234,7 @@ static void setTitleBarText_( QWidget & qgisApp )
234234

235235
fileNew(); // prepare empty project
236236

237-
mSplash->showMessage("Checking database", Qt::AlignHCenter | Qt::AlignBottom);
237+
mSplash->showMessage(tr("Checking database"), Qt::AlignHCenter | Qt::AlignBottom);
238238
qApp->processEvents();
239239
createDB();
240240

@@ -271,7 +271,7 @@ static void setTitleBarText_( QWidget & qgisApp )
271271
std::cout << "Plugins and providers are installed in " << plib.toLocal8Bit().data() << std::endl;
272272
#endif
273273
// load any plugins that were running in the last session
274-
mSplash->showMessage("Restoring loaded plugins", Qt::AlignHCenter | Qt::AlignBottom);
274+
mSplash->showMessage(tr("Restoring loaded plugins"), Qt::AlignHCenter | Qt::AlignBottom);
275275
qApp->processEvents();
276276
restoreSessionPlugins(plib);
277277

@@ -291,7 +291,7 @@ static void setTitleBarText_( QWidget & qgisApp )
291291
// Map composer
292292
mComposer = new QgsComposer(this);
293293

294-
mSplash->showMessage("Initializing file filters", Qt::AlignHCenter | Qt::AlignBottom);
294+
mSplash->showMessage(tr("Initializing file filters"), Qt::AlignHCenter | Qt::AlignBottom);
295295
qApp->processEvents();
296296
// now build vector file filter
297297
buildSupportedVectorFileFilter_( mVectorFileFilter );
@@ -316,11 +316,11 @@ static void setTitleBarText_( QWidget & qgisApp )
316316
// Please make sure this is the last thing the ctor does so that we can ensure teh
317317
// widgets are all initialised before trying to restore their state.
318318
//
319-
mSplash->showMessage("Restoring window state", Qt::AlignHCenter | Qt::AlignBottom);
319+
mSplash->showMessage(tr("Restoring window state"), Qt::AlignHCenter | Qt::AlignBottom);
320320
qApp->processEvents();
321321
restoreWindowState();
322322

323-
mSplash->showMessage("QGIS Ready!", Qt::AlignHCenter | Qt::AlignBottom);
323+
mSplash->showMessage(tr("QGIS Ready!"), Qt::AlignHCenter | Qt::AlignBottom);
324324
qApp->processEvents();
325325
} // QgisApp ctor
326326

@@ -670,7 +670,7 @@ void QgisApp::createMenus()
670670
mFileMenu = menuBar()->addMenu(tr("&File"));
671671
mFileMenu->addAction(mActionFileNew);
672672
mFileMenu->addAction(mActionFileOpen);
673-
mRecentProjectsMenu = mFileMenu->addMenu("&Open Recent Projects");
673+
mRecentProjectsMenu = mFileMenu->addMenu(tr("&Open Recent Projects"));
674674
// Connect once for the entire submenu.
675675
connect(mRecentProjectsMenu, SIGNAL(triggered(QAction *)),
676676
this, SLOT(openProject(QAction *)));
@@ -1366,7 +1366,7 @@ static void buildSupportedVectorFileFilter_(QString & fileFilters)
13661366

13671367
if (!driverRegistrar)
13681368
{
1369-
QMessageBox::warning(0,"OGR Driver Manager","unable to get OGRDriverManager");
1369+
QMessageBox::warning(0,tr("OGR Driver Manager"),tr("unable to get OGRDriverManager"));
13701370
return; // XXX good place to throw exception if we
13711371
} // XXX decide to do exceptions
13721372

@@ -5054,8 +5054,8 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,
50545054
}
50555055
else
50565056
{
5057-
QMessageBox::critical(this,"Layer is not valid",
5058-
"The layer is not a valid layer and can not be added to the map");
5057+
QMessageBox::critical(this,tr("Layer is not valid"),
5058+
tr("The layer is not a valid layer and can not be added to the map"));
50595059
}
50605060

50615061
qApp->processEvents();

‎src/plugins/copyright_label/plugin.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ QgsCopyrightLabelPlugin::~QgsCopyrightLabelPlugin()
7979
*/
8080
void QgsCopyrightLabelPlugin::initGui()
8181
{
82-
QMenu *pluginMenu = qGisInterface->getPluginMenu("&Decorations");
83-
menuId = pluginMenu->insertItem(QIcon(icon),"&CopyrightLabel", this, SLOT(run()));
82+
QMenu *pluginMenu = qGisInterface->getPluginMenu(tr("&Decorations"));
83+
menuId = pluginMenu->insertItem(QIcon(icon),tr("&CopyrightLabel"), this, SLOT(run()));
8484

85-
pluginMenu->setWhatsThis(menuId, "Creates a copyright label that is displayed on the map canvas.");
85+
pluginMenu->setWhatsThis(menuId, tr("Creates a copyright label that is displayed on the map canvas."));
8686

8787
// Create the action for tool
88-
myQActionPointer = new QAction(QIcon(icon), "Copyright Label", this);
89-
myQActionPointer->setWhatsThis("Creates a copyright label that is displayed on the map canvas.");
88+
myQActionPointer = new QAction(QIcon(icon), tr("Copyright Label"), this);
89+
myQActionPointer->setWhatsThis(tr("Creates a copyright label that is displayed on the map canvas."));
9090
// Connect the action to the run
9191
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
9292
// This calls the renderer everytime the cnavas has drawn itself
@@ -204,7 +204,7 @@ void QgsCopyrightLabelPlugin::renderLabel(QPainter * theQPainter)
204204
void QgsCopyrightLabelPlugin::unload()
205205
{
206206
// remove the GUI
207-
qGisInterface->removePluginMenuItem("&Decorations",menuId);
207+
qGisInterface->removePluginMenuItem(tr("&Decorations"),menuId);
208208
qGisInterface->removeToolBarIcon(myQActionPointer);
209209
// remove the copyright from the canvas
210210
disconnect(qGisInterface->getMapCanvas(), SIGNAL(renderComplete(QPainter *)),

‎src/plugins/delimited_text/qgsdelimitedtextplugin.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ void QgsDelimitedTextPlugin::help()
101101
*/
102102
void QgsDelimitedTextPlugin::initGui()
103103
{
104-
QMenu *pluginMenu = qGisInterface->getPluginMenu("&Delimited text");
105-
menuId = pluginMenu->insertItem(QIcon(icon),"&Add Delimited Text Layer", this, SLOT(run()));
104+
QMenu *pluginMenu = qGisInterface->getPluginMenu(tr("&Delimited text"));
105+
menuId = pluginMenu->insertItem(QIcon(icon),tr("&Add Delimited Text Layer"), this, SLOT(run()));
106106

107-
pluginMenu->setWhatsThis(menuId, "Add a delimited text file as a map layer. "
108-
"The file must have a header row containing the field names. "
109-
"X and Y fields are required and must contain coordinates in decimal units.");
107+
pluginMenu->setWhatsThis(menuId, tr("Add a delimited text file as a map layer. ")+
108+
tr("The file must have a header row containing the field names. ")+
109+
tr("X and Y fields are required and must contain coordinates in decimal units."));
110110

111111
// Create the action for tool
112-
myQActionPointer = new QAction(QIcon(icon), "Add Delimited Text Layer", this);
112+
myQActionPointer = new QAction(QIcon(icon), tr("Add Delimited Text Layer"), this);
113113

114-
myQActionPointer->setWhatsThis("Add a delimited text file as a map layer. "
115-
"The file must have a header row containing the field names. "
116-
"X and Y fields are required and must contain coordinates in decimal units.");
114+
myQActionPointer->setWhatsThis(tr("Add a delimited text file as a map layer. ")+
115+
tr("The file must have a header row containing the field names. ")+
116+
tr("X and Y fields are required and must contain coordinates in decimal units."));
117117
// Connect the action to the run
118118
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
119119
// Add the icon to the toolbar
@@ -154,7 +154,7 @@ void QgsDelimitedTextPlugin::drawVectorLayer(QString thePathNameQString,
154154
void QgsDelimitedTextPlugin::unload()
155155
{
156156
// remove the GUI
157-
qGisInterface->removePluginMenuItem("&Delimited text",menuId);
157+
qGisInterface->removePluginMenuItem(tr("&Delimited text"),menuId);
158158
qGisInterface->removeToolBarIcon(myQActionPointer);
159159
delete myQActionPointer;
160160
}

‎src/plugins/geoprocessing/qgspggeoprocessing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ void QgsPgGeoprocessing::initGui()
7575
QMenu *pluginMenu = qI->getPluginMenu(tr("&Geoprocessing"));
7676
menuId = pluginMenu->insertItem(QIcon(icon_buffer),tr("&Buffer Features"), this, SLOT(buffer()));
7777

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

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

‎src/plugins/georeferencer/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ QgsGeorefPlugin::~QgsGeorefPlugin()
108108
void QgsGeorefPlugin::initGui()
109109
{
110110
// Create the action for tool
111-
mQActionPointer = new QAction(QIcon(":/icon.png"), "&Georeferencer", this);
111+
mQActionPointer = new QAction(QIcon(":/icon.png"), tr("&Georeferencer"), this);
112112

113113
// Connect the action to the run
114114
connect(mQActionPointer, SIGNAL(activated()), this, SLOT(run()));
115115

116116
// add to the plugin menu
117-
QMenu *pluginMenu = mQGisIface->getPluginMenu("&Georeferencer");
117+
QMenu *pluginMenu = mQGisIface->getPluginMenu(tr("&Georeferencer"));
118118
pluginMenu->addAction(mQActionPointer);
119119

120120
// Add to the toolbar
@@ -139,7 +139,7 @@ void QgsGeorefPlugin::unload()
139139
{
140140
// TODO: make it work in Qt4 way
141141
// remove the GUI
142-
mQGisIface->removePluginMenuItem("&Georeferencer",mMenuId);
142+
mQGisIface->removePluginMenuItem(tr("&Georeferencer"),mMenuId);
143143
mQGisIface->removeToolBarIcon(mQActionPointer);
144144
delete mQActionPointer;
145145
}

‎src/plugins/georeferencer/plugingui.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ void QgsGeorefPluginGui::on_pbnSelectRaster_clicked() {
5656
dir = ".";
5757
QString filename =
5858
QFileDialog::getOpenFileName(this,
59-
"Choose a raster file",
59+
tr("Choose a raster file"),
6060
dir,
61-
"Raster files (*.*)");
61+
tr("Raster files (*.*)"));
6262
leSelectRaster->setText(filename);
6363
}
6464

@@ -67,8 +67,8 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {
6767

6868
// do we think that this is a valid raster?
6969
if (!QgsRasterLayer::isValidRasterFileName(leSelectRaster->text())) {
70-
QMessageBox::critical(this, "Error",
71-
"The selected file is not a valid raster file.");
70+
QMessageBox::critical(this, tr("Error"),
71+
tr("The selected file is not a valid raster file."));
7272
return;
7373
}
7474

@@ -94,10 +94,10 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {
9494
// check if there already is a world file
9595
if (!worldfile.isEmpty()) {
9696
if (QFile::exists(worldfile)) {
97-
QMessageBox::critical(this, "Error",
98-
"The selected file already seems to have a "
99-
"world file! If you want to replace it with a "
100-
"new world file, remove the old one first.");
97+
QMessageBox::critical(this, tr("Error"),
98+
tr("The selected file already seems to have a ")+
99+
tr("world file! If you want to replace it with a ")+
100+
tr("new world file, remove the old one first."));
101101
return;
102102
}
103103
}

‎src/plugins/gps_importer/qgsgpsplugin.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ QgsGPSPlugin::~QgsGPSPlugin()
103103
*/
104104
void QgsGPSPlugin::initGui()
105105
{
106-
QMenu *pluginMenu = mQGisInterface->getPluginMenu("&Gps");
107-
mMenuIdGPS = pluginMenu->insertItem(QIcon(icon),"&Gps Tools", this, SLOT(run()));
108-
mMenuIdGPX = pluginMenu->insertItem(QIcon(icon),"&Create new GPX layer", this, SLOT(createGPX()));
106+
QMenu *pluginMenu = mQGisInterface->getPluginMenu(tr("&Gps"));
107+
mMenuIdGPS = pluginMenu->insertItem(QIcon(icon),tr("&Gps Tools"), this, SLOT(run()));
108+
mMenuIdGPX = pluginMenu->insertItem(QIcon(icon),tr("&Create new GPX layer"), this, SLOT(createGPX()));
109109

110-
pluginMenu->setWhatsThis(mMenuIdGPX, "Creates a new GPX layer and displays it on the map canvas");
110+
pluginMenu->setWhatsThis(mMenuIdGPX, tr("Creates a new GPX layer and displays it on the map canvas"));
111111

112112
// add an action to the toolbar
113-
mQActionPointer = new QAction(QIcon(icon), "Gps Tools", this);
113+
mQActionPointer = new QAction(QIcon(icon), tr("Gps Tools"), this);
114114

115-
mQActionPointer->setWhatsThis( "Creates a new GPX layer and displays it on the map canvas");
115+
mQActionPointer->setWhatsThis(tr("Creates a new GPX layer and displays it on the map canvas"));
116116
connect(mQActionPointer, SIGNAL(activated()), this, SLOT(run()));
117117
mQGisInterface->addToolBarIcon(mQActionPointer);
118118
}
@@ -167,15 +167,15 @@ void QgsGPSPlugin::run()
167167
void QgsGPSPlugin::createGPX() {
168168
QString fileName =
169169
QFileDialog::getSaveFileName(mMainWindowPointer,
170-
"Save new GPX file as...", "." , "GPS eXchange file (*.gpx)");
170+
tr("Save new GPX file as..."), "." , tr("GPS eXchange file (*.gpx)"));
171171
if (!fileName.isEmpty()) {
172172
QFileInfo fileInfo(fileName);
173173
std::ofstream ofs((const char*)fileName);
174174
if (!ofs) {
175-
QMessageBox::warning(NULL, "Could not create file",
176-
"Unable to create a GPX file with the given name. "
177-
"Try again with another name or in another "
178-
"directory.");
175+
QMessageBox::warning(NULL, tr("Could not create file"),
176+
tr("Unable to create a GPX file with the given name. ")+
177+
tr("Try again with another name or in another ")+
178+
tr("directory."));
179179
return;
180180
}
181181
ofs<<"<gpx></gpx>"<<std::endl;
@@ -202,8 +202,8 @@ void QgsGPSPlugin::drawVectorLayer(QString thePathNameQString,
202202
void QgsGPSPlugin::unload()
203203
{
204204
// remove the GUI
205-
mQGisInterface->removePluginMenuItem("&Gps",mMenuIdGPS);
206-
mQGisInterface->removePluginMenuItem("&Gps",mMenuIdGPX);
205+
mQGisInterface->removePluginMenuItem(tr("&Gps"),mMenuIdGPS);
206+
mQGisInterface->removePluginMenuItem(tr("&Gps"),mMenuIdGPX);
207207
mQGisInterface->removeToolBarIcon(mQActionPointer);
208208
delete mQActionPointer;
209209
}
@@ -214,9 +214,9 @@ void QgsGPSPlugin::loadGPXFile(QString filename, bool loadWaypoints, bool loadRo
214214
//check if input file is readable
215215
QFileInfo fileInfo(filename);
216216
if (!fileInfo.isReadable()) {
217-
QMessageBox::warning(NULL, "GPX Loader",
218-
"Unable to read the selected file.\n"
219-
"Please reselect a valid file." );
217+
QMessageBox::warning(NULL, tr("GPX Loader"),
218+
tr("Unable to read the selected file.\n")+
219+
tr("Please reselect a valid file.") );
220220
return;
221221
}
222222

@@ -259,13 +259,13 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
259259
inputFilename, outputFilename);
260260
Q3Process babelProcess(babelArgs);
261261
if (!babelProcess.start()) {
262-
QMessageBox::warning(NULL, "Could not start process",
263-
"Could not start GPSBabel!");
262+
QMessageBox::warning(NULL, tr("Could not start process"),
263+
tr("Could not start GPSBabel!"));
264264
return;
265265
}
266266

267267
// wait for gpsbabel to finish (or the user to cancel)
268-
Q3ProgressDialog progressDialog("Importing data...", "Cancel", 0,
268+
Q3ProgressDialog progressDialog(tr("Importing data..."), tr("Cancel"), 0,
269269
NULL, 0, true);
270270
progressDialog.show();
271271
for (int i = 0; babelProcess.isRunning(); ++i) {
@@ -282,10 +282,10 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
282282
// did we get any data?
283283
if (babelProcess.exitStatus() != 0) {
284284
QString babelError(babelProcess.readStderr());
285-
QString errorMsg(QString("Could not import data from %1!\n\n")
285+
QString errorMsg(QString(tr("Could not import data from %1!\n\n"))
286286
.arg(inputFilename));
287287
errorMsg += babelError;
288-
QMessageBox::warning(NULL, "Error importing data", errorMsg);
288+
QMessageBox::warning(NULL, tr("Error importing data"), errorMsg);
289289
return;
290290
}
291291

@@ -329,20 +329,20 @@ void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
329329
mDevices[device]->importCommand(mBabelPath, typeArg,
330330
port, outputFilename);
331331
if (babelArgs.isEmpty()) {
332-
QMessageBox::warning(NULL, "Not supported",
333-
QString("This device does not support downloading "
334-
"of ") + features + ".");
332+
QMessageBox::warning(NULL, tr("Not supported"),
333+
QString(tr("This device does not support downloading ") +
334+
tr("of ")) + features + ".");
335335
return;
336336
}
337337
Q3Process babelProcess(babelArgs);
338338
if (!babelProcess.start()) {
339-
QMessageBox::warning(NULL, "Could not start process",
340-
"Could not start GPSBabel!");
339+
QMessageBox::warning(NULL, tr("Could not start process"),
340+
tr("Could not start GPSBabel!"));
341341
return;
342342
}
343343

344344
// wait for gpsbabel to finish (or the user to cancel)
345-
Q3ProgressDialog progressDialog("Downloading data...", "Cancel", 0,
345+
Q3ProgressDialog progressDialog(tr("Downloading data..."), tr("Cancel"), 0,
346346
NULL, 0, true);
347347
progressDialog.show();
348348
for (int i = 0; babelProcess.isRunning(); ++i) {
@@ -359,9 +359,9 @@ void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
359359
// did we get any data?
360360
if (babelProcess.exitStatus() != 0) {
361361
QString babelError(babelProcess.readStderr());
362-
QString errorMsg("Could not download data from GPS!\n\n");
362+
QString errorMsg(tr("Could not download data from GPS!\n\n"));
363363
errorMsg += babelError;
364-
QMessageBox::warning(NULL, "Error downloading data", errorMsg);
364+
QMessageBox::warning(NULL, tr("Error downloading data"), errorMsg);
365365
return;
366366
}
367367

@@ -414,20 +414,20 @@ void QgsGPSPlugin::uploadToGPS(QgsVectorLayer* gpxLayer, QString device,
414414
mDevices[device]->exportCommand(mBabelPath, typeArg,
415415
source.left(source.findRev('?')), port);
416416
if (babelArgs.isEmpty()) {
417-
QMessageBox::warning(NULL, "Not supported",
418-
QString("This device does not support uploading of ")+
417+
QMessageBox::warning(NULL, tr("Not supported"),
418+
QString(tr("This device does not support uploading of "))+
419419
features + ".");
420420
return;
421421
}
422422
Q3Process babelProcess(babelArgs);
423423
if (!babelProcess.start()) {
424-
QMessageBox::warning(NULL, "Could not start process",
425-
"Could not start GPSBabel!");
424+
QMessageBox::warning(NULL, tr("Could not start process"),
425+
tr("Could not start GPSBabel!"));
426426
return;
427427
}
428428

429429
// wait for gpsbabel to finish (or the user to cancel)
430-
Q3ProgressDialog progressDialog("Uploading data...", "Cancel", 0,
430+
Q3ProgressDialog progressDialog(tr("Uploading data..."), tr("Cancel"), 0,
431431
NULL, 0, true);
432432
progressDialog.show();
433433
for (int i = 0; babelProcess.isRunning(); ++i) {
@@ -444,9 +444,9 @@ void QgsGPSPlugin::uploadToGPS(QgsVectorLayer* gpxLayer, QString device,
444444
// did we get an error?
445445
if (babelProcess.exitStatus() != 0) {
446446
QString babelError(babelProcess.readStderr());
447-
QString errorMsg("Error while uploading data to GPS!\n\n");
447+
QString errorMsg(tr("Error while uploading data to GPS!\n\n"));
448448
errorMsg += babelError;
449-
QMessageBox::warning(NULL, "Error uploading data", errorMsg);
449+
QMessageBox::warning(NULL, tr("Error uploading data"), errorMsg);
450450
return;
451451
}
452452

‎src/plugins/gps_importer/qgsgpsplugingui.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ void QgsGPSPluginGui::on_pbnDLOutput_clicked()
131131
{
132132
QString myFileNameQString =
133133
QFileDialog::getSaveFileName(this, //parent dialog
134-
"Choose a filename to save under",
134+
tr("Choose a filename to save under"),
135135
"." , //initial dir
136-
"GPS eXchange format (*.gpx)");
136+
tr("GPS eXchange format (*.gpx)"));
137137
leDLOutput->setText(myFileNameQString);
138138
}
139139

@@ -210,7 +210,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked()
210210
dir = ".";
211211
QString myFileNameQString = QFileDialog::getOpenFileName(
212212
this, //parent dialog
213-
"Select GPX file", //caption
213+
tr("Select GPX file"), //caption
214214
dir, //initial dir
215215
myFilterString, //filters to select
216216
&myFileTypeQString); //the pointer to store selected filter
@@ -223,7 +223,7 @@ void QgsGPSPluginGui::on_pbnIMPInput_clicked() {
223223
QString myFileType;
224224
QString myFileName = QFileDialog::getOpenFileName(
225225
this, //parent dialog
226-
"Select file and format to import", //caption
226+
tr("Select file and format to import"), //caption
227227
".", //initial dir
228228
mBabelFilter,
229229
&myFileType); //the pointer to store selected filter
@@ -251,9 +251,9 @@ void QgsGPSPluginGui::on_pbnIMPInput_clicked() {
251251
void QgsGPSPluginGui::on_pbnIMPOutput_clicked() {
252252
QString myFileNameQString =
253253
QFileDialog::getSaveFileName(this, //parent dialog
254-
"Choose a filename to save under",
254+
tr("Choose a filename to save under"),
255255
".", //initial dir
256-
"GPS eXchange format (*.gpx)");
256+
tr("GPS eXchange format (*.gpx)"));
257257
leIMPOutput->setText(myFileNameQString);
258258
}
259259

‎src/plugins/grid_maker/plugin.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ int QgsGridMakerPlugin::type()
107107
*/
108108
void QgsGridMakerPlugin::initGui()
109109
{
110-
QMenu *pluginMenu = qGisInterface->getPluginMenu("&Graticules");
111-
menuId = pluginMenu->insertItem(QIcon(icon),"&GraticuleMaker", this, SLOT(run()));
110+
QMenu *pluginMenu = qGisInterface->getPluginMenu(tr("&Graticules"));
111+
menuId = pluginMenu->insertItem(QIcon(icon),tr("&GraticuleMaker"), this, SLOT(run()));
112112

113-
pluginMenu->setWhatsThis(menuId, "Creates a graticule (grid) and stores the result as a shapefile");
113+
pluginMenu->setWhatsThis(menuId, tr("Creates a graticule (grid) and stores the result as a shapefile"));
114114

115115
// Create the action for tool
116116
#if QT_VERSION < 0x040000
117-
myQActionPointer = new QAction("Graticule Creator", QIcon(icon), "&Wmi",0, this, "run");
117+
myQActionPointer = new QAction(tr("Graticule Creator"), QIcon(icon), "&Wmi",0, this, "run");
118118
#else
119-
myQActionPointer = new QAction(QIcon(icon), "Graticule Creator", this);
119+
myQActionPointer = new QAction(QIcon(icon), tr("Graticule Creator"), this);
120120
#endif
121-
myQActionPointer->setWhatsThis("Creates a graticule (grid) and stores the result as a shapefile");
121+
myQActionPointer->setWhatsThis(tr("Creates a graticule (grid) and stores the result as a shapefile"));
122122
// Connect the action to the run
123123
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
124124

@@ -158,7 +158,7 @@ void QgsGridMakerPlugin::drawVectorLayer(QString thePathNameQString, QString the
158158
void QgsGridMakerPlugin::unload()
159159
{
160160
// remove the GUI
161-
qGisInterface->removePluginMenuItem("&Graticules",menuId);
161+
qGisInterface->removePluginMenuItem(tr("&Graticules"),menuId);
162162
qGisInterface->removeToolBarIcon(myQActionPointer);
163163
delete myQActionPointer;
164164
}

‎src/plugins/grid_maker/plugingui.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ void QgsGridMakerPluginGui::on_pbnOK_clicked()
5050

5151
if (leOutputShapeFile->text().isEmpty())
5252
{
53-
QMessageBox::warning( 0, "QGIS - Grid Maker",
54-
QString("Please enter the file name before pressing OK!." ));
53+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
54+
QString(tr("Please enter the file name before pressing OK!.") ));
5555
return;
5656
}
5757

@@ -60,48 +60,48 @@ void QgsGridMakerPluginGui::on_pbnOK_clicked()
6060
double myLongitudeInterval = leLongitudeInterval->text().toDouble(&myFlag);
6161
if (!myFlag)
6262
{
63-
QMessageBox::warning( 0, "QGIS - Grid Maker",
64-
QString("Longitude Interval is invalid - please correct and try again." ));
63+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
64+
QString(tr("Longitude Interval is invalid - please correct and try again." )));
6565
return;
6666
}
6767
myFlag=false;//reset test flag
6868
double myLatitudeInterval = leLatitudeInterval->text().toDouble(&myFlag);
6969
if (!myFlag)
7070
{
71-
QMessageBox::warning( 0, "QGIS - Grid Maker",
72-
QString("Latitude Interval is invalid - please correct and try again." ));
71+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
72+
QString(tr("Latitude Interval is invalid - please correct and try again." )));
7373
return;
7474
}
7575
myFlag=false;//reset test flag
7676
double myLongitudeOrigin = leOriginLongitude->text().toDouble(&myFlag);
7777
if (!myFlag)
7878
{
79-
QMessageBox::warning( 0, "QGIS - Grid Maker",
80-
QString("Longitude Origin is invalid - please correct and try again.." ));
79+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
80+
QString(tr("Longitude Origin is invalid - please correct and try again.." )));
8181
return;
8282
}
8383
myFlag=false;//reset test flag
8484
double myLatitudeOrigin = leOriginLatitude->text().toDouble(&myFlag);
8585
if (!myFlag)
8686
{
87-
QMessageBox::warning( 0, "QGIS - Grid Maker",
88-
QString("Latitude Origin is invalid - please correct and try again." ));
87+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
88+
QString(tr("Latitude Origin is invalid - please correct and try again." )));
8989
return;
9090
}
9191
myFlag=false;//reset test flag
9292
double myEndPointLongitude = leEndPointLongitude->text().toDouble(&myFlag);
9393
if (!myFlag)
9494
{
95-
QMessageBox::warning( 0, "QGIS - Grid Maker",
96-
QString("End Point Longitude is invalid - please correct and try again." ));
95+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
96+
QString(tr("End Point Longitude is invalid - please correct and try again." )));
9797
return;
9898
}
9999
myFlag=false;//reset test flag
100100
double myEndPointLatitude = leEndPointLatitude->text().toDouble(&myFlag);
101101
if (!myFlag)
102102
{
103-
QMessageBox::warning( 0, "QGIS - Grid Maker",
104-
QString("End Point Latitude is invalid - please correct and try again." ));
103+
QMessageBox::warning( 0, tr("QGIS - Grid Maker"),
104+
QString(tr("End Point Latitude is invalid - please correct and try again." )));
105105
return;
106106
}
107107

@@ -161,9 +161,9 @@ void QgsGridMakerPluginGui::on_pbnSelectOutputFile_clicked()
161161
std::cout << " Gps File Importer Gui::pbnSelectOutputFile_clicked() " << std::endl;
162162
QString myOutputFileNameQString = QFileDialog::getSaveFileName(
163163
this,
164-
"Choose a filename to save under",
164+
tr("Choose a filename to save under"),
165165
".",
166-
"ESRI Shapefile (*.shp)");
166+
tr("ESRI Shapefile (*.shp)"));
167167

168168
if (myOutputFileNameQString.right(4) != ".shp")
169169
myOutputFileNameQString += ".shp";

‎src/plugins/scale_bar/plugin.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,18 @@ QgsScaleBarPlugin::~QgsScaleBarPlugin()
9595
*/
9696
void QgsScaleBarPlugin::initGui()
9797
{
98-
QMenu *pluginMenu = qGisInterface->getPluginMenu("&Decorations");
99-
menuId = pluginMenu->insertItem(QIcon(icon),"&ScaleBar", this, SLOT(run()));
98+
QMenu *pluginMenu = qGisInterface->getPluginMenu(tr("&Decorations"));
99+
menuId = pluginMenu->insertItem(QIcon(icon),tr("&ScaleBar"), this, SLOT(run()));
100100

101-
pluginMenu->setWhatsThis(menuId, "Creates a scale bar that is displayed on the map canvas");
101+
pluginMenu->setWhatsThis(menuId, tr("Creates a scale bar that is displayed on the map canvas"));
102102

103103
// Create the action for tool
104104
#if QT_VERSION < 0x040000
105-
myQActionPointer = new QAction("Scale Bar", QIcon(icon), "&Wmi",0, this, "run");
105+
myQActionPointer = new QAction(tr("Scale Bar"), QIcon(icon), "&Wmi",0, this, "run");
106106
#else
107-
myQActionPointer = new QAction(QIcon(icon), "Scale Bar", this);
107+
myQActionPointer = new QAction(QIcon(icon), tr("Scale Bar"), this);
108108
#endif
109-
myQActionPointer->setWhatsThis("Creates a scale bar that is displayed on the map canvas");
109+
myQActionPointer->setWhatsThis(tr("Creates a scale bar that is displayed on the map canvas"));
110110
// Connect the action to the run
111111
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
112112
//render the scale bar each time the map is rendered
@@ -517,7 +517,7 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
517517
void QgsScaleBarPlugin::unload()
518518
{
519519
// remove the GUI
520-
qGisInterface->removePluginMenuItem("&Decorations",menuId);
520+
qGisInterface->removePluginMenuItem(tr("&Decorations"),menuId);
521521
qGisInterface->removeToolBarIcon(myQActionPointer);
522522

523523
// remove the northarrow from the canvas

0 commit comments

Comments
 (0)
Please sign in to comment.