summaryrefslogtreecommitdiffstats
path: root/src/extension/output.cpp
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/output.cpp
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/output.cpp')
-rw-r--r--src/extension/output.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/extension/output.cpp b/src/extension/output.cpp
index b4f483a91..05a0de997 100644
--- a/src/extension/output.cpp
+++ b/src/extension/output.cpp
@@ -148,23 +148,35 @@ Output::get_extension()
\return The name of the filetype supported
\brief Get the name of the filetype supported
*/
-gchar *
-Output::get_filetypename()
+const char *
+Output::get_filetypename(bool translated)
{
- if (filetypename != nullptr)
- return filetypename;
+ const char *name;
+
+ if (filetypename)
+ name = filetypename;
else
- return get_name();
+ name = get_name();
+
+ if (name && translated) {
+ return get_translation(name);
+ } else {
+ return name;
+ }
}
/**
\return Tooltip giving more information on the filetype
\brief Get the tooltip for more information on the filetype
*/
-gchar *
-Output::get_filetypetooltip()
+const char *
+Output::get_filetypetooltip(bool translated)
{
- return filetypetooltip;
+ if (filetypetooltip && translated) {
+ return get_translation(filetypetooltip);
+ } else {
+ return filetypetooltip;
+ }
}
/**
@@ -187,7 +199,8 @@ Output::prefs ()
return true;
}
- PrefDialog * dialog = new PrefDialog(this->get_name(), controls);
+ Glib::ustring title = get_translation(this->get_name());
+ PrefDialog *dialog = new PrefDialog(title, controls);
int response = dialog->run();
dialog->hide();