mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Better error message when failing to load translations
This commit is contained in:
parent
21fbec2820
commit
000bb4c89e
@ -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))
|
||||
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…
x
Reference in New Issue
Block a user