mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix translator for English not being returned on other locales
This commit is contained in:
parent
b018850f24
commit
d1f94b510c
@ -155,6 +155,8 @@ def get_translator(bcp_47_code):
|
||||
lang = {'pt':'pt_BR', 'zh':'zh_CN'}.get(lang, lang)
|
||||
available = available_translations()
|
||||
found = True
|
||||
if lang == 'en':
|
||||
return found, lang, NullTranslations()
|
||||
if lang not in available:
|
||||
lang = {'pt':'pt_BR', 'zh':'zh_CN'}.get(parts[0], parts[0])
|
||||
if lang not in available:
|
||||
@ -162,8 +164,6 @@ def get_translator(bcp_47_code):
|
||||
if lang not in available:
|
||||
lang = 'en'
|
||||
found = False
|
||||
if lang == 'en':
|
||||
return found, lang, NullTranslations()
|
||||
return found, lang, get_single_translator(lang)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user