From f27b65652e72d71411e8b658ecfc8992bbc73836 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sat, 2 Oct 2010 17:51:34 +0200 Subject: Extensions. New context support in extensions (enum attribute only), should fix Bug #585730 (Please split msgid Lines for ja translation). Fixed bugs: - https://launchpad.net/bugs/585730 (bzr r9809) --- src/extension/param/enum.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/extension/param/enum.cpp') diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 03c1f839b..9ed5aac16 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -63,12 +63,20 @@ ParamComboBox::ParamComboBox (const gchar * name, const gchar * guitext, const g Glib::ustring newguitext, newvalue; const char * contents = NULL; if (node->firstChild()) contents = node->firstChild()->content(); - if (contents != NULL) + if (contents != NULL) { // don't translate when 'item' but do translate when '_item' // NOTE: internal extensions use build_from_mem and don't need _item but // still need to include if are to be localized - newguitext = !strcmp(chname, INKSCAPE_EXTENSION_NS "_item") ? _(contents) : contents; - else + if (!strcmp(chname, INKSCAPE_EXTENSION_NS "_item")) { + if (node->attribute("msgctxt") != NULL) { + newguitext = g_dpgettext2(NULL, node->attribute("msgctxt"), contents); + } else { + newguitext = _(contents); + } + } else { + newguitext = contents; + } + } else continue; const char * val = node->attribute("value"); -- cgit v1.2.3