summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-04-24 18:59:06 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-04-24 18:59:06 +0000
commitbab6dfe02bd9556c931973a272e154251764e88e (patch)
tree4e63e6d40ee6c6757bcdd5754d0cc97af0ae15a4 /src
parentFix crash when modifying text in "Text and Font" dialog (diff)
downloadinkscape-bab6dfe02bd9556c931973a272e154251764e88e.tar.gz
inkscape-bab6dfe02bd9556c931973a272e154251764e88e.zip
Restore r14955 which was reverted in r15047 due to messed up merge
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14955 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15047 Fixed bugs: - https://launchpad.net/bugs/1669951 (bzr r15633)
Diffstat (limited to 'src')
-rw-r--r--src/extension/param/bool.cpp2
-rw-r--r--src/extension/param/enum.cpp2
-rw-r--r--src/extension/param/float.cpp4
-rw-r--r--src/extension/param/int.cpp5
-rw-r--r--src/extension/param/parameter.cpp11
-rw-r--r--src/extension/param/radiobutton.cpp2
-rw-r--r--src/extension/param/string.cpp2
7 files changed, 19 insertions, 9 deletions
diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp
index 9f8d3dcc0..a2f4f82c2 100644
--- a/src/extension/param/bool.cpp
+++ b/src/extension/param/bool.cpp
@@ -136,7 +136,7 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node,
auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, Parameter::GUI_PARAM_WIDGETS_SPACING));
hbox->set_homogeneous(false);
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
label->show();
hbox->pack_end(*label, true, true);
diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp
index a26458c35..7a79e32bb 100644
--- a/src/extension/param/enum.cpp
+++ b/src/extension/param/enum.cpp
@@ -251,7 +251,7 @@ Gtk::Widget *ParamComboBox::get_widget(SPDocument * doc, Inkscape::XML::Node * n
}
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, Parameter::GUI_PARAM_WIDGETS_SPACING));
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, false, false);
diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp
index e3fdba826..e9bb45c2e 100644
--- a/src/extension/param/float.cpp
+++ b/src/extension/param/float.cpp
@@ -181,7 +181,7 @@ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * nod
if (_mode == FULL) {
- UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_(_text), fadjust, _precision);
+ UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_text, fadjust, _precision);
scale->set_size_request(400, -1);
scale->show();
hbox->pack_start(*scale, true, true);
@@ -189,7 +189,7 @@ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * nod
}
else if (_mode == MINIMAL) {
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, true, true);
diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp
index 538ddc08d..e81b0a526 100644
--- a/src/extension/param/int.cpp
+++ b/src/extension/param/int.cpp
@@ -162,14 +162,13 @@ ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal
if (_mode == FULL) {
- UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_(_text), fadjust, 0);
+ UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(_text, fadjust, 0);
scale->set_size_request(400, -1);
scale->show();
hbox->pack_start(*scale, true, true);
}
else if (_mode == MINIMAL) {
-
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, true, true);
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp
index 0eb491078..2c72c61df 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>
@@ -65,6 +66,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) {
diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp
index 178dc20e8..df3c37e55 100644
--- a/src/extension/param/radiobutton.cpp
+++ b/src/extension/param/radiobutton.cpp
@@ -306,7 +306,7 @@ Gtk::Widget * ParamRadioButton::get_widget(SPDocument * doc, Inkscape::XML::Node
auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
vbox->set_homogeneous(false);
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START, Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START, Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, false, false);
diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp
index 0c5238f99..86895f217 100644
--- a/src/extension/param/string.cpp
+++ b/src/extension/param/string.cpp
@@ -169,7 +169,7 @@ Gtk::Widget * ParamString::get_widget(SPDocument * doc, Inkscape::XML::Node * no
}
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, Parameter::GUI_PARAM_WIDGETS_SPACING));
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START));
label->show();
hbox->pack_start(*label, false, false);