summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-i18n/ibus-pinyin/files/ibus-pinyin-1.5.0-gettext.patch')
-rw-r--r--app-i18n/ibus-pinyin/files/ibus-pinyin-1.5.0-gettext.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/app-i18n/ibus-pinyin/files/ibus-pinyin-1.5.0-gettext.patch b/app-i18n/ibus-pinyin/files/ibus-pinyin-1.5.0-gettext.patch
new file mode 100644
index 000000000000..2014bad9820a
--- /dev/null
+++ b/app-i18n/ibus-pinyin/files/ibus-pinyin-1.5.0-gettext.patch
@@ -0,0 +1,16 @@
+--- a/setup/main.py
++++ b/setup/main.py
+@@ -45,7 +45,12 @@ class PreferencesDialog:
+ locale.setlocale(locale.LC_ALL, "")
+ localedir = os.getenv("IBUS_LOCALEDIR")
+ gettext.bindtextdomain("ibus-pinyin", localedir)
+- gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8")
++ # Python's gettext module doesn't provide all methods in
++ # new Python version since Python 3.10
++ try:
++ gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8")
++ except AttributeError:
++ pass
+
+ self.__bus = IBus.Bus()
+ self.__config = self.__bus.get_config()