mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
[UI] Fix setting gettext to unicode for Py2 compat
This commit is contained in:
parent
9b92bc2baf
commit
e3f537770f
1 changed files with 5 additions and 1 deletions
|
@ -122,7 +122,11 @@ def setup_translations(setup_gettext=True, setup_pygtk=False):
|
|||
gettext.bindtextdomain(domain, translations_path)
|
||||
gettext.bind_textdomain_codeset(domain, 'UTF-8')
|
||||
gettext.textdomain(domain)
|
||||
gettext.install(domain, translations_path, names='ngettext')
|
||||
|
||||
# Workaround for Python 2 unicode gettext (keyword removed in Py3).
|
||||
kwargs = {} if not deluge.common.PY2 else {'unicode': True}
|
||||
|
||||
gettext.install(domain, translations_path, names='ngettext', **kwargs)
|
||||
__builtin__.__dict__['_n'] = __builtin__.__dict__['ngettext']
|
||||
except Exception as ex:
|
||||
log.error('Unable to initialize gettext/locale!')
|
||||
|
|
Loading…
Add table
Reference in a new issue