mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04: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
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import os, locale, re, io
|
import os, locale, re, io
|
||||||
from gettext import GNUTranslations, NullTranslations
|
from gettext import GNUTranslations, NullTranslations
|
||||||
|
|
||||||
from polyglot.builtins import unicode_type
|
from polyglot.builtins import is_py3, unicode_type
|
||||||
|
|
||||||
_available_translations = None
|
_available_translations = None
|
||||||
|
|
||||||
@ -244,7 +244,10 @@ def set_translators():
|
|||||||
set_translators.lang = t.info().get('language')
|
set_translators.lang = t.info().get('language')
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
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
|
# 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
|
# for the global prefs object as it was instantiated in get_lang(), before
|
||||||
# the translator was installed.
|
# the translator was installed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user