summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-08-03 23:34:27 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-08-31 14:50:38 +0000
commitea05ba3338bec1517826614f27935a36c3b0f0f8 (patch)
treedce3126f09fe834a6bf165031d28c607dba73327 /src/extension/prefdialog
parentRemove unused "nopref" variant of effects (diff)
downloadinkscape-ea05ba3338bec1517826614f27935a36c3b0f0f8.tar.gz
inkscape-ea05ba3338bec1517826614f27935a36c3b0f0f8.zip
Implement "translationdomain" attribute for extensions
Will allow extensions to ship their own message catalog used for translation of the extension#s strings. Needs to be set on the root <inkscape-extension> element of the .inx Currently supported values: - unset: use default textdomain (which happens to be 'inkscape') - 'inkscape': use Inkscape's message catalog - 'none': disable translation for the extension's strings
Diffstat (limited to 'src/extension/prefdialog')
-rw-r--r--src/extension/prefdialog/parameter.cpp8
-rw-r--r--src/extension/prefdialog/prefdialog.cpp4
2 files changed, 3 insertions, 9 deletions
diff --git a/src/extension/prefdialog/parameter.cpp b/src/extension/prefdialog/parameter.cpp
index 18d2a40ec..5716a3be8 100644
--- a/src/extension/prefdialog/parameter.cpp
+++ b/src/extension/prefdialog/parameter.cpp
@@ -325,13 +325,7 @@ Parameter *Parameter::get_param(const gchar */*name*/)
const char *Parameter::get_translation(const char* msgid) {
- // TODO: translation domain
-
- if (_context) {
- return g_dpgettext2(nullptr, _context, msgid);
- } else {
- return _(msgid);
- }
+ return _extension->get_translation(msgid, _context);
}
Glib::ustring const extension_pref_root = "/extensions/";
diff --git a/src/extension/prefdialog/prefdialog.cpp b/src/extension/prefdialog/prefdialog.cpp
index 17deb7a20..a1966ec8d 100644
--- a/src/extension/prefdialog/prefdialog.cpp
+++ b/src/extension/prefdialog/prefdialog.cpp
@@ -35,7 +35,7 @@ namespace Extension {
/** \brief Creates a new preference dialog for extension preferences
- \param name Name of the Extension whose dialog this is
+ \param name Name of the Extension whose dialog this is (should already be translated)
\param controls The extension specific widgets in the dialog
This function initializes the dialog with the name of the extension
@@ -43,7 +43,7 @@ namespace Extension {
them. It also places the passed-in widgets into the dialog.
*/
PrefDialog::PrefDialog (Glib::ustring name, Gtk::Widget * controls, Effect * effect) :
- Gtk::Dialog(_(name.c_str()), true),
+ Gtk::Dialog(name, true),
_name(name),
_button_ok(nullptr),
_button_cancel(nullptr),