mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-03 07:41:58 -04:00
Avoid unnecessary traceback when loading plugins that dont have translations for the current UI language
This commit is contained in:
parent
dd7e53dece
commit
94bfe038da
@ -94,7 +94,11 @@ def load_translations(namespace, zfp):
|
||||
if not lang or lang == 'en': # performance optimization
|
||||
_translations_cache[zfp] = None
|
||||
return
|
||||
mo = get_resources(zfp, 'translations/%s.mo' % lang)
|
||||
with zipfile.ZipFile(zfp) as zf:
|
||||
try:
|
||||
mo = zf.read('translations/%s.mo' % lang)
|
||||
except KeyError:
|
||||
mo = None # No translations for this language present
|
||||
if mo is None:
|
||||
_translations_cache[zfp] = None
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user