[gimp] plug-ins: localization calls must happens inside query().
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: localization calls must happens inside query().
- Date: Fri, 2 Aug 2019 11:01:33 +0000 (UTC)
commit 3945701bd64638091452655dbe667d5ce5b444b3
Author: Jehan <jehan girinstud io>
Date: Fri Aug 2 12:58:37 2019 +0200
plug-ins: localization calls must happens inside query().
It's a bit weird because this has to happen during the query() step, but
plug-ins don't have access to this step anymore, apart from
query_procedures(), which then turns out to be badly named.
plug-ins/python/palette-to-gradient.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/plug-ins/python/palette-to-gradient.py b/plug-ins/python/palette-to-gradient.py
index efea15df52..9d0bc59306 100644
--- a/plug-ins/python/palette-to-gradient.py
+++ b/plug-ins/python/palette-to-gradient.py
@@ -51,11 +51,6 @@ def make_gradient(palette, num_segments, num_colors):
return len(retval), retval
def palette_to_gradient(procedure, args, data):
- # Localization
- plug_in = procedure.get_plug_in()
- plug_in.set_translation_domain ("gimp30-python",
- Gio.file_new_for_path(Gimp.locale_directory()))
-
palette = Gimp.context_get_palette()
(_, num_colors) = Gimp.palette_get_info(palette)
@@ -80,6 +75,10 @@ def palette_to_gradient(procedure, args, data):
class PaletteToGradient (Gimp.PlugIn):
def do_query_procedures(self):
+ # Localization
+ self.set_translation_domain ("gimp30-python",
+ Gio.file_new_for_path(Gimp.locale_directory()))
+
# XXX See pygobject#352 for the weird return value.
return ['python-fu-palette-to-gradient',
'python-fu-palette-to-gradient-repeating'], 2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]