summaryrefslogtreecommitdiffstats
path: root/src/extension/param/parameter.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2016-06-05 17:35:39 +0000
committerEduard Braun <eduard.braun2@gmx.de>2016-06-05 17:35:39 +0000
commit6f15692726681034391d42c58aa870e9dbba642f (patch)
tree683150639022dc4273f9726694a57a8a64c5b4dd /src/extension/param/parameter.cpp
parent[Bug #1545333] Convenience option (default: ON) for cmake builds to enable SV... (diff)
downloadinkscape-6f15692726681034391d42c58aa870e9dbba642f.tar.gz
inkscape-6f15692726681034391d42c58aa870e9dbba642f.zip
Extensions: Fixes and improvements for "gui-text" parameter attribute
- "gui-text" was always translated (as opposed to only "_gui-text") - This made it impossible to have parameters without label (since the empty string returns the whole .po file header when translated), which caused an issue in restack extension - Added possibility to specify "msgctxt" for "gui-text" (bzr r14955)
Diffstat (limited to 'src/extension/param/parameter.cpp')
-rw-r--r--src/extension/param/parameter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp
index 10029893f..27d9bdf9b 100644
--- a/src/extension/param/parameter.cpp
+++ b/src/extension/param/parameter.cpp
@@ -20,6 +20,7 @@
#endif
#include <cstring>
+#include <glibmm/i18n.h>
#include "ui/widget/color-notebook.h"
#include <xml/node.h>
@@ -56,6 +57,16 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex
const char *guitext = in_repr->attribute("gui-text");
if (guitext == NULL) {
guitext = in_repr->attribute("_gui-text");
+ if (guitext == NULL) {
+ // guitext = ""; // propably better to require devs to explicitly set an empty gui-text if this is what they want
+ } else {
+ const char *context = in_repr->attribute("msgctxt");
+ if (context != NULL) {
+ guitext = g_dpgettext2(NULL, context, guitext);
+ } else {
+ guitext = _(guitext);
+ }
+ }
}
const char *gui_tip = in_repr->attribute("gui-tip");
if (gui_tip == NULL) {