summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3dab26d)
raw | patch | inline | side by side (parent: 3dab26d)
author | JazzyNico <nicoduf@yahoo.fr> | |
Sat, 9 Oct 2010 07:14:28 +0000 (09:14 +0200) | ||
committer | JazzyNico <nicoduf@yahoo.fr> | |
Sat, 9 Oct 2010 07:14:28 +0000 (09:14 +0200) |
index d73439414498ba341cdc10c6a6e38943a55c7cd6..f17b45b4bdbb378db7a12eb9467692769f7fb291 100644 (file)
if (defaultval != NULL)
_value = g_strdup(defaultval);
-
+
+ _context = xml->attribute("msgctxt");
+
return;
}
{
if (_gui_hidden) return NULL;
- Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_value), Gtk::ALIGN_LEFT));
+ Glib::ustring newguitext;
+
+ if (_context != NULL) {
+ newguitext = g_dpgettext2(NULL, _context, _value);
+ } else {
+ newguitext = _(_value);
+ }
+
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(newguitext, Gtk::ALIGN_LEFT));
+
label->set_line_wrap();
label->show();
index c305ea6dfcc09b700a4c7fa714253d9470023039..c56b5c21def03b89e1ffd083f637f2082b2f3106 100644 (file)
private:
/** \brief Internal value. */
gchar * _value;
+ const gchar* _context;
public:
ParamDescription(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
index 8bdb7f3827b51ae60c476b7d17845db7226c1a24..abf5f8beb470048e3430ddfe5ab11b035e664969 100755 (executable)
if (defaultval != NULL)
_value = g_strdup(defaultval);
+ _context = xml->attribute("msgctxt");
+
return;
}
{
if (_gui_hidden) return NULL;
- Gtk::Label * label = Gtk::manage(new Gtk::Label(Glib::ustring("<b>") + _(_value) + Glib::ustring("</b>"), Gtk::ALIGN_LEFT));
+ Glib::ustring newguitext;
+
+ if (_context != NULL) {
+ newguitext = g_dpgettext2(NULL, _context, _value);
+ } else {
+ newguitext = _(_value);
+ }
+
+ Gtk::Label * label = Gtk::manage(new Gtk::Label(Glib::ustring("<b>") +newguitext + Glib::ustring("</b>"), Gtk::ALIGN_LEFT));
label->set_line_wrap();
label->set_padding(0,5);
label->set_use_markup(true);
index 92908caaa57a1e05ce0b94204ec2c747c4c35d9c..94fe880f9de4d20d945fbea75fefe96fb6d2f60a 100755 (executable)
private:
/** \brief Internal value. */
gchar * _value;
+ const gchar* _context;
public:
ParamGroupHeader(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
index c17839001f94282b782325bc3f70931189851834..23655baeaf47808f3db836f3771a273ddf2a6a74 100644 (file)
Glib::ustring * newvalue = NULL;
const char * contents = sp_repr_children(child_repr)->content();
- if (contents != NULL)
- // don't translate when 'option' but do translate when '_option'
- newguitext = new Glib::ustring( !strcmp(chname, INKSCAPE_EXTENSION_NS "_option") ? _(contents) : contents );
- else
+ if (contents != NULL) {
+ // don't translate when 'item' but do translate when '_option'
+ if (!strcmp(chname, INKSCAPE_EXTENSION_NS "_option")) {
+ if (child_repr->attribute("msgctxt") != NULL) {
+ newguitext = new Glib::ustring(g_dpgettext2(NULL, child_repr->attribute("msgctxt"), contents));
+ } else {
+ newguitext = new Glib::ustring(_(contents));
+ }
+ } else {
+ newguitext = new Glib::ustring(contents);
+ }
+ } else
continue;
+
+
const char * val = child_repr->attribute("value");
if (val != NULL)
newvalue = new Glib::ustring(val);