mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
get_translator() should not raise an exception
This commit is contained in:
parent
0f653b4d99
commit
4854c187f3
@ -129,6 +129,8 @@ def get_translator(bcp_47_code):
|
|||||||
lang = {'pt':'pt_BR', 'zh':'zh_CN'}.get(parts[0], parts[0])
|
lang = {'pt':'pt_BR', 'zh':'zh_CN'}.get(parts[0], parts[0])
|
||||||
if lang not in available:
|
if lang not in available:
|
||||||
lang = get_lang()
|
lang = get_lang()
|
||||||
|
if lang not in available:
|
||||||
|
lang = 'en'
|
||||||
found = False
|
found = False
|
||||||
if lang == 'en':
|
if lang == 'en':
|
||||||
return found, lang, NullTranslations()
|
return found, lang, NullTranslations()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user