plug-ins/pygimp/plug-ins/clothify.py need to call gettext.install here,

2006-09-20  Sven Neumann  <sven@gimp.org>

	* plug-ins/pygimp/plug-ins/clothify.py
	* plug-ins/pygimp/plug-ins/gimpcons.py: need to call gettext.install
	here, otherwise we can't use _() in the register() call.

	* plug-ins/pygimp/gimpfu.py: don't call gettext.install() for the
	plug-in. Translate the blurb used as a user hint.
This commit is contained in:
Sven Neumann 2006-09-20 11:33:47 +00:00 committed by Sven Neumann
parent d3904c6d85
commit 8ae9aa43fe
6 changed files with 99 additions and 42 deletions

View File

@ -1,3 +1,12 @@
2006-09-20 Sven Neumann <sven@gimp.org>
* plug-ins/pygimp/plug-ins/clothify.py
* plug-ins/pygimp/plug-ins/gimpcons.py: need to call gettext.install
here, otherwise we can't use _() in the register() call.
* plug-ins/pygimp/gimpfu.py: don't call gettext.install() for the
plug-in. Translate the blurb used as a user hint.
2006-09-20 Sven Neumann <sven@gimp.org> 2006-09-20 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1): * app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1):

View File

@ -65,7 +65,7 @@ expect a fifth element in their description tuple -- a 3-tuple of the form
If want to localize your plug-in, add an optional domain parameter to the If want to localize your plug-in, add an optional domain parameter to the
register call. It can be the name of the translation domain or a tuple that register call. It can be the name of the translation domain or a tuple that
consists of the translation domain and the directory where the translations consists of the translation domain and the directory where the translations
are installed. You can then use N_() and _() to localize your plug-in. are installed.
''' '''
import string as _string import string as _string
@ -532,6 +532,13 @@ def _interact(proc_name, start_params):
vbox.show() vbox.show()
if blurb: if blurb:
if domain:
try:
(domain, locale_dir) = domain
trans = gettext.translation(domain, locale_dir, fallback=True)
except ValueError:
trans = gettext.translation(domain, fallback=True)
blurb = trans.ugettext(blurb)
box = gimpui.HintBox(blurb) box = gimpui.HintBox(blurb)
vbox.pack_start(box, expand=False) vbox.pack_start(box, expand=False)
box.show() box.show()
@ -628,14 +635,6 @@ def _run(proc_name, params):
plugin_type = _registered_plugins_[proc_name][7] plugin_type = _registered_plugins_[proc_name][7]
func = _registered_plugins_[proc_name][10] func = _registered_plugins_[proc_name][10]
menu = _registered_plugins_[proc_name][11] menu = _registered_plugins_[proc_name][11]
domain = _registered_plugins_[proc_name][12]
if domain:
try:
(domain, locale_dir) = domain
gettext.install(domain, locale_dir, unicode=1)
except ValueError:
gettext.install(domain, unicode=1)
if plugin_type == PLUGIN and menu[:7] == '<Image>': if plugin_type == PLUGIN and menu[:7] == '<Image>':
end = 3 end = 3

View File

@ -20,6 +20,8 @@
import math import math
from gimpfu import * from gimpfu import *
gettext.install("gimp20-python", gimp.locale_directory, unicode=1)
def clothify(timg, tdrawable, bx=9, by=9, azimuth=135, elevation=45, depth=3): def clothify(timg, tdrawable, bx=9, by=9, azimuth=135, elevation=45, depth=3):
width = tdrawable.width width = tdrawable.width
height = tdrawable.height height = tdrawable.height
@ -27,7 +29,7 @@ def clothify(timg, tdrawable, bx=9, by=9, azimuth=135, elevation=45, depth=3):
img = gimp.Image(width, height, RGB) img = gimp.Image(width, height, RGB)
img.disable_undo() img.disable_undo()
layer_one = gimp.Layer(img, "X Dots", width, height, RGB_IMAGE, layer_one = gimp.Layer(img, _("X Dots"), width, height, RGB_IMAGE,
100, NORMAL_MODE) 100, NORMAL_MODE)
img.add_layer(layer_one, 0) img.add_layer(layer_one, 0)
pdb.gimp_edit_fill(layer_one, BACKGROUND_FILL) pdb.gimp_edit_fill(layer_one, BACKGROUND_FILL)
@ -36,7 +38,7 @@ def clothify(timg, tdrawable, bx=9, by=9, azimuth=135, elevation=45, depth=3):
layer_two = layer_one.copy() layer_two = layer_one.copy()
layer_two.mode = MULTIPLY_MODE layer_two.mode = MULTIPLY_MODE
layer_two.name = "Y Dots" layer_two.name = _("Y Dots")
img.add_layer(layer_two, 0) img.add_layer(layer_two, 0)
pdb.plug_in_gauss_rle(img, layer_one, bx, 1, 0) pdb.plug_in_gauss_rle(img, layer_one, bx, 1, 0)
@ -54,22 +56,24 @@ def clothify(timg, tdrawable, bx=9, by=9, azimuth=135, elevation=45, depth=3):
gimp.delete(img) gimp.delete(img)
register( register(
"python-fu-clothify", "python-fu-clothify",
"Make the specified layer look like it is printed on cloth", N_("Make the image look like it is printed on cloth"),
"Make the specified layer look like it is printed on cloth", "Make the specified drawable look like it is printed on cloth",
"James Henstridge", "James Henstridge",
"James Henstridge", "James Henstridge",
"1997-1999", "1997-1999",
"_Clothify...", N_("_Clothify..."),
"RGB*, GRAY*", "RGB*, GRAY*",
[ [
(PF_INT, "x-blur", "X blur", 9), (PF_INT, "x-blur", _("Horizontal blur"), 9),
(PF_INT, "y-blur", "Y blur", 9), (PF_INT, "y-blur", _("Vertical blur"), 9),
(PF_INT, "azimuth", "Azimuth", 135), (PF_INT, "azimuth", _("Azimuth"), 135),
(PF_INT, "elevation", "Elevation", 45), (PF_INT, "elevation", _("Elevation"), 45),
(PF_INT, "depth", "Depth", 3) (PF_INT, "depth", _("Depth"), 3)
], ],
[], [],
clothify, menu="<Image>/Filters/Artistic") clothify,
menu="<Image>/Filters/Artistic",
domain=("gimp20-python", gimp.locale_directory))
main() main()

View File

@ -19,6 +19,8 @@
from gimpfu import * from gimpfu import *
gettext.install("gimp20-python", gimp.locale_directory, unicode=1)
def console(): def console():
import pygtk import pygtk
pygtk.require('2.0') pygtk.require('2.0')
@ -104,6 +106,8 @@ register(
"", "",
[], [],
[], [],
console, menu="<Toolbox>/Xtns/Languages/Python-Fu", domain="gimp20-python") console,
menu="<Toolbox>/Xtns/Languages/Python-Fu",
domain=("gimp20-python", gimp.locale_directory))
main() main()

View File

@ -5,5 +5,6 @@ plug-ins/pygimp/gimpfu.py
plug-ins/pygimp/gimpui.py plug-ins/pygimp/gimpui.py
plug-ins/pygimp/procbrowser.c plug-ins/pygimp/procbrowser.c
plug-ins/pygimp/plug-ins/clothify.py
plug-ins/pygimp/plug-ins/gimpcons.py plug-ins/pygimp/plug-ins/gimpcons.py
plug-ins/pygimp/plug-ins/gtkcons.py plug-ins/pygimp/plug-ins/gtkcons.py

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gimp-python HEAD\n" "Project-Id-Version: gimp-python HEAD\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-09-15 13:29+0200\n" "POT-Creation-Date: 2006-09-20 13:15+0200\n"
"PO-Revision-Date: 2006-09-15 13:30+0200\n" "PO-Revision-Date: 2006-09-20 13:18+0200\n"
"Last-Translator: Sven Neumann <sven@gimp.org>\n" "Last-Translator: Sven Neumann <sven@gimp.org>\n"
"Language-Team: German <gnome-de@gnome.org>\n" "Language-Team: German <gnome-de@gnome.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -15,47 +15,87 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../plug-ins/pygimp/gimpfu.py:394 ../plug-ins/pygimp/gimpfu.py:406 #: ../plug-ins/pygimp/gimpfu.py:407 ../plug-ins/pygimp/gimpfu.py:419
#: ../plug-ins/pygimp/gimpfu.py:412 #: ../plug-ins/pygimp/gimpfu.py:425
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
#: ../plug-ins/pygimp/gimpfu.py:404 ../plug-ins/pygimp/gimpfu.py:412 #: ../plug-ins/pygimp/gimpfu.py:417 ../plug-ins/pygimp/gimpfu.py:425
msgid "Yes" msgid "Yes"
msgstr "Ja" msgstr "Ja"
#: ../plug-ins/pygimp/gimpfu.py:450 #: ../plug-ins/pygimp/gimpfu.py:463 ../plug-ins/pygimp/gimpui.py:200
msgid "Python-Fu File Selection" msgid "Python-Fu File Selection"
msgstr "Python-Fu Dateiauswahl" msgstr "Python-Fu Dateiauswahl"
#: ../plug-ins/pygimp/gimpfu.py:461 #: ../plug-ins/pygimp/gimpfu.py:474
msgid "Python-Fu Folder Selection" msgid "Python-Fu Folder Selection"
msgstr "Python-Fu Verzeichnisauswahl" msgstr "Python-Fu Verzeichnisauswahl"
#: ../plug-ins/pygimp/gimpui.py:153
msgid "Python-Fu Color Selection"
msgstr "Python-Fu Farbauswahl"
#: ../plug-ins/pygimp/procbrowser.c:174 #: ../plug-ins/pygimp/procbrowser.c:174
msgid "Python Procedure Browser" msgid "Python Procedure Browser"
msgstr "Python Prozedurbrowser" msgstr "Python Prozedurbrowser"
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:42 #: ../plug-ins/pygimp/plug-ins/clothify.py:32
msgid "X Dots"
msgstr "X Punkte"
#: ../plug-ins/pygimp/plug-ins/clothify.py:41
msgid "Y Dots"
msgstr "Y Punkte"
#: ../plug-ins/pygimp/plug-ins/clothify.py:60
msgid "Make the image look like it is printed on cloth"
msgstr "Lässt das Bild aussehen wie auf Leinen gedruckt"
#: ../plug-ins/pygimp/plug-ins/clothify.py:65
msgid "_Clothify..."
msgstr "_Leinen..."
#: ../plug-ins/pygimp/plug-ins/clothify.py:68
msgid "Horizontal blur"
msgstr "Horizontales Weichzeichnen"
#: ../plug-ins/pygimp/plug-ins/clothify.py:69
msgid "Vertical blur"
msgstr "Vertikales Weichzeichnen"
#: ../plug-ins/pygimp/plug-ins/clothify.py:70
msgid "Azimuth"
msgstr "Azimut"
#: ../plug-ins/pygimp/plug-ins/clothify.py:71
msgid "Elevation"
msgstr "Erhebung"
#: ../plug-ins/pygimp/plug-ins/clothify.py:72
msgid "Depth"
msgstr "Tiefe"
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:44
msgid "Python Console" msgid "Python Console"
msgstr "Python Konsole" msgstr "Python Konsole"
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:74 #: ../plug-ins/pygimp/plug-ins/gimpcons.py:76
msgid "_Browse..." msgid "_Browse..."
msgstr "_Durchsuchen …" msgstr "_Durchsuchen …"
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:98 #: ../plug-ins/pygimp/plug-ins/gimpcons.py:100
msgid "Interactive Gimp-Python interpreter" msgid "Interactive Gimp-Python interpreter"
msgstr "Interaktiver Gimp-Python Interpreter" msgstr "Interaktiver Gimp-Python Interpreter"
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:103 #: ../plug-ins/pygimp/plug-ins/gimpcons.py:105
msgid "_Console" msgid "_Console"
msgstr "_Konsole" msgstr "_Konsole"
#: ../plug-ins/pygimp/plug-ins/gtkcons.py:217 #: ../plug-ins/pygimp/plug-ins/gtkcons.py:221
msgid "Gimp-Python Console" msgid "Gimp-Python Console"
msgstr "Gimp-Python Konsole" msgstr "Gimp-Python Konsole"
#: ../plug-ins/pygimp/plug-ins/gtkcons.py:218 #: ../plug-ins/pygimp/plug-ins/gtkcons.py:222
msgid "Interactive Python Development" msgid "Interactive Python Development"
msgstr "Interaktive Python Entwicklung" msgstr "Interaktive Python Entwicklung"