Catch error if no translation is found
This commit is contained in:
parent
a34bf54c46
commit
dad7def794
|
@ -136,7 +136,11 @@ if hasattr(locale, 'bindtextdomain'):
|
||||||
gettext.textdomain(DOMAIN)
|
gettext.textdomain(DOMAIN)
|
||||||
|
|
||||||
gettext.install(DOMAIN, _localedir)
|
gettext.install(DOMAIN, _localedir)
|
||||||
_ = gettext.translation(DOMAIN, _localedir).gettext
|
|
||||||
|
try:
|
||||||
|
_ = gettext.translation(DOMAIN, _localedir).gettext
|
||||||
|
except OSError:
|
||||||
|
_ = gettext.gettext
|
||||||
|
|
||||||
if gettext._translations:
|
if gettext._translations:
|
||||||
_translations = list(gettext._translations.values())[0]
|
_translations = list(gettext._translations.values())[0]
|
||||||
|
|
Loading…
Reference in New Issue