mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-07 02:06:01 +01:00
py3: gettext no longer has a unicode= argument
This is unicode by default "since there's no point in translating to byte strings." Good riddance.
This commit is contained in:
parent
042d740593
commit
2d382274cd
1 changed files with 5 additions and 2 deletions
|
|
@ -9,7 +9,7 @@
|
|||
import os, locale, re, io
|
||||
from gettext import GNUTranslations, NullTranslations
|
||||
|
||||
from polyglot.builtins import unicode_type
|
||||
from polyglot.builtins import is_py3, unicode_type
|
||||
|
||||
_available_translations = None
|
||||
|
||||
|
|
@ -244,7 +244,10 @@ def set_translators():
|
|||
set_translators.lang = t.info().get('language')
|
||||
except Exception:
|
||||
pass
|
||||
t.install(unicode=True, names=('ngettext',))
|
||||
if is_py3:
|
||||
t.install(names=('ngettext',))
|
||||
else:
|
||||
t.install(unicode=True, names=('ngettext',))
|
||||
# Now that we have installed a translator, we have to retranslate the help
|
||||
# for the global prefs object as it was instantiated in get_lang(), before
|
||||
# the translator was installed.
|
||||
|
|
|
|||
Loading…
Reference in a new issue