From bc24a38c135c2db93e5c2776fc4d77c5bc67fea2 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sat, 9 Oct 2010 09:14:28 +0200 Subject: Extensions, i18n. Adding context to description, groupheader and radiobutton extension parameters. (bzr r9821) --- src/extension/param/radiobutton.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/extension/param/radiobutton.cpp') diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index c17839001..23655baea 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -84,12 +84,22 @@ ParamRadioButton::ParamRadioButton (const gchar * name, 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); -- cgit v1.2.3