mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Another py3 compat fix
This commit is contained in:
parent
47b3638371
commit
8ce99d51c7
1 changed files with 3 additions and 1 deletions
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import io
|
||||
from gettext import GNUTranslations
|
||||
from calibre.constants import ispy3
|
||||
from calibre.utils.localization import get_lc_messages_path
|
||||
from zipfile import ZipFile
|
||||
|
||||
|
|
@ -34,4 +35,5 @@ def translate(lang, text):
|
|||
_CACHE[lang] = trans
|
||||
if trans is None:
|
||||
return getattr(__builtins__, '_', lambda x: x)(text)
|
||||
return trans.ugettext(text)
|
||||
f = getattr(trans, 'gettext' if ispy3 else 'ugettext')
|
||||
return f(text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue