Skip to content

Commit 65a41b7

Browse files
author
g_j_m
committed
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
}

0 commit comments

Comments
 (0)