summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2010-10-02 15:51:34 +0000
committerJazzyNico <nicoduf@yahoo.fr>2010-10-02 15:51:34 +0000
commitf27b65652e72d71411e8b658ecfc8992bbc73836 (patch)
tree89f4bf0025b3f475164d2a88b6cdabd77a5f6f10
parentDutch translation and pot update (diff)
downloadinkscape-f27b65652e72d71411e8b658ecfc8992bbc73836.tar.gz
inkscape-f27b65652e72d71411e8b658ecfc8992bbc73836.zip
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)
-rw-r--r--po/inkscape.pot31
-rw-r--r--share/extensions/split.inx6
-rw-r--r--src/extension/param/enum.cpp14
3 files changed, 33 insertions, 18 deletions
diff --git a/po/inkscape.pot b/po/inkscape.pot
index ab8629e40..a2de67bed 100644
--- a/po/inkscape.pot
+++ b/po/inkscape.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: inkscape-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2010-10-02 11:32+0200\n"
+"POT-Creation-Date: 2010-10-02 17:43+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -258,7 +258,7 @@ msgstr ""
#: ../share/extensions/pathalongpath.inx.h:7
#: ../share/extensions/pathscatter.inx.h:10
#: ../share/extensions/radiusrand.inx.h:6 ../share/extensions/scour.inx.h:11
-#: ../share/extensions/split.inx.h:4
+#: ../share/extensions/split.inx.h:2
#: ../share/extensions/webslicer_create_group.inx.h:7
#: ../share/extensions/webslicer_export.inx.h:6
#: ../share/extensions/web-set-att.inx.h:6
@@ -874,7 +874,7 @@ msgstr ""
msgid "Generate from Path"
msgstr ""
-#: ../share/extensions/extrude.inx.h:3 ../share/extensions/split.inx.h:3
+#: ../share/extensions/extrude.inx.h:3
msgid "Lines"
msgstr ""
@@ -2212,7 +2212,7 @@ msgstr ""
#. this->AddNewObjectsStyle(_page_lpetool, "/tools/lpetool");
#. Text
#: ../share/extensions/lorem_ipsum.inx.h:7
-#: ../share/extensions/replace_font.inx.h:10 ../share/extensions/split.inx.h:8
+#: ../share/extensions/replace_font.inx.h:10 ../share/extensions/split.inx.h:6
#: ../share/extensions/text_braille.inx.h:2
#: ../share/extensions/text_flipcase.inx.h:1
#: ../share/extensions/text_lowercase.inx.h:1
@@ -3253,27 +3253,34 @@ msgstr ""
msgid "r - Gear Radius (px):"
msgstr ""
-#: ../share/extensions/split.inx.h:2
-msgid "Letters"
-msgstr ""
-
-#: ../share/extensions/split.inx.h:5
+#: ../share/extensions/split.inx.h:3
msgid "Preserve original text"
msgstr ""
-#: ../share/extensions/split.inx.h:6
+#: ../share/extensions/split.inx.h:4
msgid "Split text"
msgstr ""
-#: ../share/extensions/split.inx.h:7
+#: ../share/extensions/split.inx.h:5
msgid "Split:"
msgstr ""
-#: ../share/extensions/split.inx.h:9
+#: ../share/extensions/split.inx.h:7
msgid "This effect splits texts into different lines, words or letters."
msgstr ""
+#: ../share/extensions/split.inx.h:8
+msgctxt "split"
+msgid "Letters"
+msgstr ""
+
+#: ../share/extensions/split.inx.h:9
+msgctxt "split"
+msgid "Lines"
+msgstr ""
+
#: ../share/extensions/split.inx.h:10
+msgctxt "split"
msgid "Words"
msgstr ""
diff --git a/share/extensions/split.inx b/share/extensions/split.inx
index 63e0fd6ca..12e443011 100644
--- a/share/extensions/split.inx
+++ b/share/extensions/split.inx
@@ -7,9 +7,9 @@
<param name="tab" type="notebook">
<page name="Options" _gui-text="Options">
<param name="splittype" type="enum" _gui-text="Split:">
- <_item value="line">Lines</_item>
- <_item value="word">Words</_item>
- <_item value="letter">Letters</_item>
+ <_item msgctxt="split" value="line">Lines</_item>
+ <_item msgctxt="split" value="word">Words</_item>
+ <_item msgctxt="split" value="letter">Letters</_item>
</param>
<param name="preserve" type="boolean" _gui-text="Preserve original text">true</param>
</page>
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");