mirror of https://github.com/GNOME/gimp.git
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:
parent
a773e1cdc8
commit
c02b4836dd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue