From: JazzyNico Date: Sat, 2 Oct 2010 15:51:34 +0000 (+0200) Subject: Extensions. New context support in extensions (enum attribute only), should fix Bug... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5a814bded3ce707aa9a058259b09574e0c08677e;p=inkscape.git Extensions. New context support in extensions (enum attribute only), should fix Bug #585730 (Please split msgid Lines for ja translation). --- 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 \n" "Language-Team: LANGUAGE \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 @@ - <_item value="line">Lines - <_item value="word">Words - <_item value="letter">Letters + <_item msgctxt="split" value="line">Lines + <_item msgctxt="split" value="word">Words + <_item msgctxt="split" value="letter">Letters true 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");