extensions: remove call to gettext.bind_textdomain_codeset().

I added this call originally, mimicking the C plug-ins. Yet in Python,
this function is deprecated since Python 3.8 and removed in 3.10.
Looking closer in the docs, it looks like Python's gettext module works
differently.

While all the *gettext() functions return strings in the locale's
encoding in C, unless overriden by bind_textdomain_codeset() (therefore
we need this call, in order to have locale-independent string encoding),
this is not the case in Python, whose gettext() call is already
locale-independent. The gettext.bind_textdomain_codeset() function only
applies to the specific l*gettext() functions which are deprecated too.

Fixes the warning:

> goat-exercise-py3.py:37: DeprecationWarning: bind_textdomain_codeset() is deprecated
This commit is contained in:
Jehan 2022-05-25 10:59:12 +02:00
parent a773e1cdc8
commit c02b4836dd
1 changed files with 0 additions and 1 deletions

View File

@ -34,7 +34,6 @@ import sys
# 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.textdomain(textdomain)
_ = gettext.gettext
def N_(message): return message