From bcd53f13e2f8547266a915dac0fc4c0012bfcf87 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Mon, 24 Apr 2017 21:43:24 +0200 Subject: 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) --- src/extension/param/parameter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/extension/param/parameter.cpp') 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; { -- cgit v1.2.3