summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-04-24 19:43:24 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-04-24 19:43:24 +0000
commitbcd53f13e2f8547266a915dac0fc4c0012bfcf87 (patch)
treea340f97f45db5c41b72aca56a16187f6ed87a654 /src
parentExtensions: Some refactoring for code clarity and consistency (diff)
downloadinkscape-bcd53f13e2f8547266a915dac0fc4c0012bfcf87.tar.gz
inkscape-bcd53f13e2f8547266a915dac0fc4c0012bfcf87.zip
Extensions: Fixes and improvements for "gui-description" parameter attribute along the lines of r14955
- "gui-description" was always translated (as opposed to only "_gui-description") - Added possibility to specify "msgctxt" for "_gui-description" (bzr r15635)
Diffstat (limited to 'src')
-rw-r--r--src/extension/extension.cpp2
-rw-r--r--src/extension/param/notebook.cpp2
-rw-r--r--src/extension/param/parameter.cpp8
3 files changed, 10 insertions, 2 deletions
diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp
index ebdc83b94..497f98431 100644
--- a/src/extension/extension.cpp
+++ b/src/extension/extension.cpp
@@ -701,7 +701,7 @@ public:
#endif
this->pack_start(*widg, false, false, 0);
if (tooltip) {
- widg->set_tooltip_text(_(tooltip));
+ widg->set_tooltip_text(tooltip);
} else {
widg->set_tooltip_text("");
widg->set_has_tooltip(false);
diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp
index a31dda421..4e94b5216 100644
--- a/src/extension/param/notebook.cpp
+++ b/src/extension/param/notebook.cpp
@@ -211,7 +211,7 @@ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Nod
gchar const * tip = param->get_tooltip();
if (tip) {
- widg->set_tooltip_text(_(tip));
+ widg->set_tooltip_text(tip);
} else {
widg->set_tooltip_text("");
widg->set_has_tooltip(false);
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp
index eeffbecf2..e2093158d 100644
--- a/src/extension/param/parameter.cpp
+++ b/src/extension/param/parameter.cpp
@@ -80,6 +80,14 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex
const char *description = in_repr->attribute("gui-description");
if (description == NULL) {
description = in_repr->attribute("_gui-description");
+ if (description != NULL) {
+ const char *context = in_repr->attribute("msgctxt");
+ if (context != NULL) {
+ description = g_dpgettext2(NULL, context, description);
+ } else {
+ description = _(description);
+ }
+ }
}
bool hidden = false;
{