Commit 0d01567b authored by Jehan's avatar Jehan

extensions: flag labels and documentation strings for localization…

… with N_().
Also fix the domain in self.set_translation_domain() call.
Actually I'll have to dig deeper in this function which apparently is
only used for menu entries. Yet it does feel quite redundant with
calling textdomain() and other gettext calls ourselves. Probably we can
make plug-in localization more straightforward.
parent 59292c14
Pipeline #222250 passed with stages
in 36 minutes and 39 seconds
......@@ -29,17 +29,22 @@ import os
import sys
# Set-up localization for your plug-in with your own text domain.
gettext.bindtextdomain('gimp30-std-plug-ins', Gimp.locale_directory())
gettext.bind_textdomain_codeset('gimp30-std-plug-ins', 'UTF-8')
# This is complementary to the gimp_plug_in_set_translation_domain()
# which is only useful for the menu entries inside GIMP interface,
# whereas the below calls are used for localization within the plug-in.
textdomain = 'gimp30-std-plug-ins'
gettext.bindtextdomain(textdomain, Gimp.locale_directory())
gettext.bind_textdomain_codeset(textdomain, 'UTF-8')
_ = gettext.gettext
def N_(message): return message
class Goat (Gimp.PlugIn):
## GimpPlugIn virtual methods ##
def do_query_procedures(self):
# Localization
# Localization for the menu entries. It has to be called in the
# query function only.
return [ "plug-in-goat-exercise-python" ]
......@@ -51,12 +56,12 @@ class Goat (Gimp.PlugIn):
procedure.set_menu_label("Exercise a goat and a python")
procedure.set_menu_label(N_("Exercise a goat and a python"))
procedure.add_menu_path('<Image>/Filters/Development/Goat exercises/')
procedure.set_documentation("Exercise a goat in the Python 3 language",
"Takes a goat for a walk in Python 3",
procedure.set_documentation(N_("Exercise a goat in the Python 3 language"),
N_("Takes a goat for a walk in Python 3"),
procedure.set_attribution("Jehan", "Jehan", "2019")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment