diff options
| author | Peng Wu <alexepico@gmail.com> | 2022-09-09 17:13:51 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2022-09-09 17:13:51 +0800 |
| commit | e5ff336fcbd5e4362855a0ec9d05acb4d4405b92 (patch) | |
| tree | 94e71ea8fb144499fa393e00223b5f98ce923d51 /setup | |
| parent | 94c96c7acd73fe2862d97a154430cd9a12d4b5fe (diff) | |
| download | ibus-libzhuyin-e5ff336fcbd5e4362855a0ec9d05acb4d4405b92.tar.gz ibus-libzhuyin-e5ff336fcbd5e4362855a0ec9d05acb4d4405b92.tar.xz ibus-libzhuyin-e5ff336fcbd5e4362855a0ec9d05acb4d4405b92.zip | |
Fix gettext usage
Diffstat (limited to 'setup')
| -rw-r--r-- | setup/main.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/setup/main.py b/setup/main.py index b3ebaba..211de10 100644 --- a/setup/main.py +++ b/setup/main.py @@ -57,8 +57,13 @@ try: except AttributeError: pass -gettext.bindtextdomain(DOMAINNAME, localedir) -gettext.bind_textdomain_codeset(DOMAINNAME, 'UTF-8') +# Python's gettext module doesn't provide all methods in +# new Python version +try: + gettext.bindtextdomain(DOMAINNAME, localedir) + gettext.bind_textdomain_codeset(DOMAINNAME, 'UTF-8') +except AttributeError: + pass gettext.install(DOMAINNAME, localedir) |
