mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:35:18 +02:00
Better error message when failing to load translations
This commit is contained in:
parent
21fbec2820
commit
000bb4c89e
1 changed files with 6 additions and 1 deletions
|
|
@ -137,7 +137,12 @@ def get_single_translator(mpath, which='messages'):
|
|||
from zipfile import ZipFile
|
||||
with ZipFile(P('localization/locales.zip', allow_user_override=False), 'r') as zf:
|
||||
buf = io.BytesIO(zf.read(mpath + '/%s.mo' % which))
|
||||
return GNUTranslations(buf)
|
||||
try:
|
||||
return GNUTranslations(buf)
|
||||
except Exception as e:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
raise ValueError('Failed to load translations for: {} with error: {}'.format(mpath, e))
|
||||
|
||||
|
||||
def get_iso639_translator(lang):
|
||||
|
|
|
|||
Loading…
Reference in a new issue