Skip to content

Commit 020a1ce

Browse files
author
g_j_m
committed
Make the plugin name, description, and version available for
translation. Also tidy up the plugin descriptions. git-svn-id: http://svn.osgeo.org/qgis/trunk@6301 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent eb6ea22 commit 020a1ce

File tree

12 files changed

+47
-42
lines changed

12 files changed

+47
-42
lines changed

src/plugins/copyright_label/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ email : tim@linfiniti.com
5252

5353
static const char * const ident_ = "$Id$";
5454

55-
static const char * const name_ = "CopyrightLabel";
56-
static const char * const description_ = "This plugin overlays copyright information on the rendered map.";
57-
static const char * const version_ = "Version 0.1";
55+
static const QString name_ = QObject::tr("CopyrightLabel");
56+
static const QString description_ = QObject::tr("Draws copyright information");
57+
static const QString version_ = QObject::tr("Version 0.1");
5858
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
5959

6060

src/plugins/delimited_text/qgsdelimitedtextplugin.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
#define QGISEXTERN extern "C"
4747
#endif
4848

49-
static const char *pluginVersion = "Version 0.2";
49+
static const QString pluginVersion = QObject::tr("Version 0.2");
50+
static const QString description_ = QObject::tr("Loads and displays delimited text files containing x,y coordinates");
5051
/**
5152
* Constructor for the plugin. The plugin is passed a pointer to the main app
5253
* and an interface object that provides access to exposed functions in QGIS.
@@ -57,9 +58,9 @@ static const char *pluginVersion = "Version 0.2";
5758
qgisMainWindowPointer(theQGisApp), qGisInterface(theQgisInterFace)
5859
{
5960
/** Initialize the plugin and set the required attributes */
60-
pluginNameQString = "DelimitedTextLayer";
61-
pluginVersionQString = "Version 0.1";
62-
pluginDescriptionQString = "This plugin provides support for delimited text files containing x,y coordinates";
61+
pluginNameQString = tr("DelimitedTextLayer");
62+
pluginVersionQString = pluginVersion;
63+
pluginDescriptionQString = description_;
6364

6465
}
6566

@@ -162,13 +163,13 @@ QGISEXTERN QgisPlugin * classFactory(QgisApp * theQGisAppPointer,
162163
// the class may not yet be insantiated when this method is called.
163164
QGISEXTERN QString name()
164165
{
165-
return QString("Add Delimited Text Layer");
166+
return QString(QObject::tr("Add Delimited Text Layer"));
166167
}
167168

168169
// Return the description
169170
QGISEXTERN QString description()
170171
{
171-
return QString("This plugin provides support for delimited text files containing x,y coordinates");
172+
return description_;
172173
}
173174

174175
// Return the type (either UI or MapLayer plugin)

src/plugins/georeferencer/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
#endif
6161

6262
static const char * const sIdent = "$Id$";
63-
static const char * const sName = "Georeferencer";
64-
static const char * const sDescription = "The georeferencer plugin is a tool for adding projection info to rasters";
65-
static const char * const sPluginVersion = "Version 0.1";
63+
static const QString sName = QObject::tr("Georeferencer");
64+
static const QString sDescription = QObject::tr("Adding projection info to rasters");
65+
static const QString sPluginVersion = QObject::tr("Version 0.1");
6666
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
6767

6868
//////////////////////////////////////////////////////////////////////

src/plugins/gps_importer/qgsgpsplugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757

5858
static const char * const ident_ =
5959
"$Id$";
60-
static const char * const name_ = "GPS Tools";
61-
static const char * const description_ =
62-
"Tools for loading and importing GPS data.";
63-
static const char * const version_ = "Version 0.1";
60+
static const QString name_ = QObject::tr("GPS Tools");
61+
static const QString description_ =
62+
QObject::tr("Tools for loading and importing GPS data");
63+
static const QString version_ = QObject::tr("Version 0.1");
6464
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
6565

6666

src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extern "C" {
7777
#include "grass_edit.xpm"
7878
#include "grass_region.xpm"
7979
#include "grass_region_edit.xpm"
80-
static const char *pluginVersion = "Version 0.1";
80+
static const QString pluginVersion = QObject::tr("Version 0.1");
8181

8282
/**
8383
* Constructor for the plugin. The plugin is passed a pointer to the main app
@@ -89,9 +89,9 @@ QgsGrassPlugin::QgsGrassPlugin(QgisApp * theQGisApp, QgisIface * theQgisInterFac
8989
mQgis(theQGisApp), qGisInterface(theQgisInterFace)
9090
{
9191
/** Initialize the plugin and set the required attributes */
92-
pluginNameQString = "GrassVector";
93-
pluginVersionQString = "0.1";
94-
pluginDescriptionQString = "GRASS layer";
92+
pluginNameQString = tr("GrassVector");
93+
pluginVersionQString = tr("0.1");
94+
pluginDescriptionQString = tr("GRASS layer");
9595
}
9696

9797
QgsGrassPlugin::~QgsGrassPlugin()
@@ -831,13 +831,13 @@ extern "C" QgisPlugin * classFactory(QgisApp * theQGisAppPointer, QgisIface * th
831831
// the class may not yet be insantiated when this method is called.
832832
extern "C" QString name()
833833
{
834-
return QString("GRASS");
834+
return QObject::tr("GRASS");
835835
}
836836

837837
// Return the description
838838
extern "C" QString description()
839839
{
840-
return QString("GRASS layer");
840+
return QObject::tr("GRASS layer");
841841
}
842842

843843
// Return the type (either UI or MapLayer plugin)

src/plugins/grid_maker/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ email : tim@linfiniti.com
4747

4848
static const char * const ident_ = "$Id$";
4949

50-
static const char * const name_ = "Graticule Creator";
51-
static const char * const description_ = "A graticule building plugin.";
52-
static const char * const version_ = "Version 0.1";
50+
static const QString name_ = QObject::tr("Graticule Creator");
51+
static const QString description_ = QObject::tr("Builds a graticule");
52+
static const QString version_ = QObject::tr("Version 0.1");
5353
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
5454
/**
5555
* Constructor for the plugin. The plugin is passed a pointer to the main app

src/plugins/north_arrow/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ email : tim@linfiniti.com
5454
//
5555
static const char * const ident_ = "$Id$";
5656

57-
static const char * const name_ = "NorthArrow";
58-
static const char * const description_ = "This plugin displays a north arrow overlayed onto the map.";
59-
static const char * const version_ = "Version 0.1";
57+
static const QString name_ = QObject::tr("NorthArrow");
58+
static const QString description_ = QObject::tr("Displays a north arrow overlayed onto the map");
59+
static const QString version_ = QObject::tr("Version 0.1");
6060
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
6161

6262
const double QgsNorthArrowPlugin::PI = 3.14159265358979323846;

src/plugins/plugin_template/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
#endif
5454

5555
static const char * const sIdent = "$Id$";
56-
static const char * const sName = "[menuitemname]";
57-
static const char * const sDescription = "[plugindescription]";
58-
static const char * const sPluginVersion = "Version 0.1";
56+
static const QString sName = QObject::tr("[menuitemname]");
57+
static const QString sDescription = QObject::tr("[plugindescription]");
58+
static const QString sPluginVersion = QObject::tr("Version 0.1");
5959
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
6060

6161
//////////////////////////////////////////////////////////////////////

src/plugins/qgisplugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define QGISPLUGIN_H
2222

2323

24-
#include <qstring.h>
24+
#include <QString>
2525

2626
#include <qgisapp.h>
2727

src/plugins/scale_bar/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ email : sbr00pwb@users.sourceforge.net
5959

6060
static const char * const ident_ = "$Id$";
6161

62-
static const char * const name_ = "ScaleBar";
63-
static const char * const description_ = "Plugin to draw scale bar on map";
64-
static const char * const version_ = "Version 0.1";
62+
static const QString name_ = QObject::tr("ScaleBar");
63+
static const QString description_ = QObject::tr("Draws a scale bar");
64+
static const QString version_ = QObject::tr("Version 0.1");
6565
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
6666

6767

src/plugins/spit/qgsspitplugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939

4040
static const char * const ident_ = "$Id$";
4141

42-
static const char * const name_ = "SPIT";
43-
static const char * const description_ = "Shapefile to PostgreSQL/PostGIS Import Tool";
44-
static const char * const version_ = "Version 0.1";
42+
static const QString name_ = QObject::tr("SPIT");
43+
static const QString description_ = QObject::tr("Shapefile to PostgreSQL/PostGIS Import Tool");
44+
static const QString version_ = QObject::tr("Version 0.1");
4545
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
4646

4747

src/plugins/wfs/qgswfsplugin.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
#define QGISEXTERN extern "C"
3131
#endif
3232

33-
QgsWFSPlugin::QgsWFSPlugin(QgisApp* app, QgisIface* iface): QgisPlugin("WFS plugin", "A plugin to add WFS layers to the QGIS canvas", "Version 0.0001", QgisPlugin::MAPLAYER), mApp(app), mIface(iface), mWfsDialogAction(0)
33+
static const QString name_ = QObject::tr("WFS plugin");
34+
static const QString description_ = QObject::tr("Adds WFS layers to the QGIS canvas");
35+
static const QString version_ = QObject::tr("Version 0.0001");
36+
37+
QgsWFSPlugin::QgsWFSPlugin(QgisApp* app, QgisIface* iface): QgisPlugin(name_, description_, version_, QgisPlugin::MAPLAYER), mApp(app), mIface(iface), mWfsDialogAction(0)
3438
{
3539

3640
}
@@ -72,17 +76,17 @@ QGISEXTERN QgisPlugin * classFactory(QgisApp * theQGisAppPointer, QgisIface * th
7276

7377
QGISEXTERN QString name()
7478
{
75-
return QString("WFS plugin");
79+
return name_;
7680
}
7781

7882
QGISEXTERN QString description()
7983
{
80-
return QString("A plugin to add WFS layers to the QGIS canvas");
84+
return description_;
8185
}
8286

8387
QGISEXTERN QString version()
8488
{
85-
return QString("Version 0.0001");
89+
return version_;
8690
}
8791

8892
QGISEXTERN int type()

0 commit comments

Comments
 (0)