plug-ins: fix relocatability of the Python Console.

If we were running Gimp.locale_directory() at the very start of the
script, it would append before _gimp_reloc_init_lib() had happened, and
therefore the returned value would be the non-relocated locale
directory.

Calling this inside set_i18n() happens later, and also feels like the
proper place for this code.
This commit is contained in:
Jehan 2025-04-09 00:07:22 +02:00
parent 64d63cd937
commit 884353ed3d

View file

@ -34,7 +34,6 @@ import pyconsole
import gettext
textdomain = "gimp30-python"
gettext.bindtextdomain(textdomain, Gimp.locale_directory())
gettext.textdomain(textdomain)
_ = gettext.gettext
@ -303,6 +302,7 @@ def run(procedure, config, data):
class PythonConsole (Gimp.PlugIn):
## GimpPlugIn virtual methods ##
def do_set_i18n(self, name):
gettext.bindtextdomain(textdomain, Gimp.locale_directory())
return True, 'gimp30-python', None
def do_query_procedures(self):