mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
cli: Skip gettext setup if setting locale fails
Can happen if user provides a busted locale
This commit is contained in:
parent
680f44ec93
commit
9c23dfa992
@ -85,7 +85,12 @@ def setup_logging(appname, debug_stdout):
|
|||||||
sys.excepthook = exception_log
|
sys.excepthook = exception_log
|
||||||
|
|
||||||
def setup_i18n(gettext_app, gettext_dir):
|
def setup_i18n(gettext_app, gettext_dir):
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
try:
|
||||||
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
except:
|
||||||
|
# Can happen if user passed a bogus LANG
|
||||||
|
pass
|
||||||
|
|
||||||
gettext.install(gettext_app, gettext_dir)
|
gettext.install(gettext_app, gettext_dir)
|
||||||
gettext.bindtextdomain(gettext_app, gettext_dir)
|
gettext.bindtextdomain(gettext_app, gettext_dir)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user