From 48e52e674a2d0bb4a34aea71a6793eedf0d5cbb9 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 21 Sep 2006 11:19:43 +0000 Subject: [PATCH] plug-ins/pygimp/gimpui.override (_wrap_gimp_dialog_new) allow String or 2006-09-21 Sven Neumann * plug-ins/pygimp/gimpui.override (_wrap_gimp_dialog_new) * plug-ins/pygimp/pygimp-drawable.c (drw_set_name): allow String or Unicode objects. * plug-ins/pygimp/plug-ins/colorxhtml.py: prepared for translation. --- ChangeLog | 9 +++++- plug-ins/pygimp/gimpui.override | 2 +- plug-ins/pygimp/plug-ins/colorxhtml.py | 30 ++++++++++--------- plug-ins/pygimp/pygimp-drawable.c | 2 +- po-python/POTFILES.in | 1 + po-python/de.po | 40 ++++++++++++++++++++++++-- 6 files changed, 66 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index d594daa4ce..66f8bba5d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-09-21 Sven Neumann + + * plug-ins/pygimp/gimpui.override (_wrap_gimp_dialog_new) + * plug-ins/pygimp/pygimp-drawable.c (drw_set_name): allow String + or Unicode objects. + + * plug-ins/pygimp/plug-ins/colorxhtml.py: prepared for translation. + 2006-09-21 Sven Neumann * plug-ins/gfig/gfig-dialog.c: pass correct parameters to @@ -8,7 +16,6 @@ 2006-09-21 Sven Neumann - * plug-ins/script-fu/scripts/test-sphere.scm ("script-fu-test-sphere"): * app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1): use the same code on all platforms. The optimization for bytes == 4 was pointless anyway. diff --git a/plug-ins/pygimp/gimpui.override b/plug-ins/pygimp/gimpui.override index 741da30a6b..5e6238b10c 100644 --- a/plug-ins/pygimp/gimpui.override +++ b/plug-ins/pygimp/gimpui.override @@ -556,7 +556,7 @@ _wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs) for (i = 0; i < len; i += 2) { PyObject *text = PyTuple_GetItem(py_buttons, i); PyObject *id = PyTuple_GetItem(py_buttons, i + 1); - if (!PyString_Check(text)) { + if (!PyString_Check(text) && !PyUnicode_Check(text)) { gtk_object_destroy(GTK_OBJECT(self->obj)); self->obj = NULL; PyErr_SetString(PyExc_RuntimeError, diff --git a/plug-ins/pygimp/plug-ins/colorxhtml.py b/plug-ins/pygimp/plug-ins/colorxhtml.py index 4cf12fdb1f..22cac0f588 100755 --- a/plug-ins/pygimp/plug-ins/colorxhtml.py +++ b/plug-ins/pygimp/plug-ins/colorxhtml.py @@ -25,6 +25,8 @@ import os.path import gimp from gimpfu import * +gettext.install("gimp20-python", gimp.locale_directory, unicode=1) + (CHARS_SOURCE, CHARS_FILE, CHARS_PARAMETER) = range(3) escape_table = { @@ -101,7 +103,7 @@ def colorxhtml(img, drawable, filename, raw_filename, pr = drawable.get_pixel_rgn(0, 0, width, height, False, False) - gimp.progress_init("Saving '%s' as COLORXHTML..." % filename) + gimp.progress_init(_("Saving as colored XHTML")) style = style_def % size @@ -178,24 +180,26 @@ class RowIterator: register( "file-colorxhtml-save", - "Saves the image as colored XHTML text", - "Saves the image as colored XHTML text (based on perl version by Marc Lehmann)", + _("Save the image as colored XHTML"), + "Saves the image as colored XHTML text (based on Perl version by Marc Lehmann)", "Manish Singh and Carol Spears", "Manish Singh and Carol Spears", "2003", - "Colored XHTML", + N_("Colored XHTML"), "RGB", [ - (PF_RADIO, "source", "Where to take the characters from", 0, - (("Source code", CHARS_SOURCE), - ("Text file", CHARS_FILE), - ("Entry box", CHARS_PARAMETER))), - (PF_FILE, "characters", "The filename to read or the characters to use", - ""), - (PF_INT, "font-size", "The font size in pixels", 10), - (PF_BOOL, "separate", "Separate CSS file", True) + (PF_RADIO, "source", _("Character source"), 0, + ((_("Source code"), CHARS_SOURCE), + (_("Text file"), CHARS_FILE), + (_("Entry box"), CHARS_PARAMETER))), + (PF_FILE, "characters", _("File to read or characters to use"), + ""), + (PF_INT, "font-size", _("Font size in pixels"), 10), + (PF_BOOL, "separate", _("Write a separate CSS file"), True) ], [], - colorxhtml, menu="", on_query=register_save) + colorxhtml, on_query=register_save, + menu="", domain=("gimp20-python", gimp.locale_directory) + ) main() diff --git a/plug-ins/pygimp/pygimp-drawable.c b/plug-ins/pygimp/pygimp-drawable.c index bfbce0f2ac..05ad8e3197 100644 --- a/plug-ins/pygimp/pygimp-drawable.c +++ b/plug-ins/pygimp/pygimp-drawable.c @@ -931,7 +931,7 @@ drw_set_name(PyGimpDrawable *self, PyObject *value, void *closure) return -1; } - if (!PyUnicode_Check(value)) { + if (!PyString_Check(value) && !PyUnicode_Check(value)) { PyErr_SetString(PyExc_TypeError, "type mismatch"); return -1; } diff --git a/po-python/POTFILES.in b/po-python/POTFILES.in index 2fb5b066db..e515f48e37 100644 --- a/po-python/POTFILES.in +++ b/po-python/POTFILES.in @@ -5,5 +5,6 @@ plug-ins/pygimp/gimpfu.py plug-ins/pygimp/gimpui.py plug-ins/pygimp/procbrowser.c +plug-ins/pygimp/plug-ins/colorxhtml.py plug-ins/pygimp/plug-ins/gimpcons.py plug-ins/pygimp/plug-ins/gtkcons.py diff --git a/po-python/de.po b/po-python/de.po index 0c8cff4eab..5b7195e115 100644 --- a/po-python/de.po +++ b/po-python/de.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gimp-python HEAD\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-09-20 13:45+0200\n" -"PO-Revision-Date: 2006-09-20 13:18+0200\n" +"POT-Creation-Date: 2006-09-21 12:25+0200\n" +"PO-Revision-Date: 2006-09-21 12:27+0200\n" "Last-Translator: Sven Neumann \n" "Language-Team: German \n" "MIME-Version: 1.0\n" @@ -40,6 +40,42 @@ msgstr "Python-Fu Farbauswahl" msgid "Python Procedure Browser" msgstr "Python Prozedurbrowser" +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:106 +msgid "Saving as colored XHTML" +msgstr "Speichere als farbiges XHTML" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:188 +msgid "Colored XHTML" +msgstr "Farbiges XHTML" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:191 +msgid "Character source" +msgstr "Quelle für Buchstaben" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:192 +msgid "Source code" +msgstr "Quellcode" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:193 +msgid "Text file" +msgstr "Textdatei" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:194 +msgid "Entry box" +msgstr "Eingabefeld" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:195 +msgid "File to read or characters to use" +msgstr "Dateiname oder Buchstaben" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:197 +msgid "Font size in pixels" +msgstr "Schriftgrösse in Pixeln" + +#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:198 +msgid "Write a separate CSS file" +msgstr "Erstelle separate CSS Datei" + #: ../plug-ins/pygimp/plug-ins/gimpcons.py:44 msgid "Python Console" msgstr "Python Konsole"