Module: check_mk
Branch: master
Commit: 7a89ad62d36a00811ba365c1b5946300e73624c4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7a89ad62d36a00…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 29 15:33:56 2018 +0200
Fixed recently introduced issue by werk #6511
Change-Id: Ic9baed6fe24386dae5b94cb053652b987c6cc3d7
---
cmk/gui/i18n.py | 5 ++++-
cmk/gui/wato/__init__.py | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/cmk/gui/i18n.py b/cmk/gui/i18n.py
index c5adef9..bda2d99 100644
--- a/cmk/gui/i18n.py
+++ b/cmk/gui/i18n.py
@@ -75,7 +75,10 @@ def _get_language_dirs():
def get_language_alias(lang):
- # type: (str) -> Text
+ # type: (Optional[str]) -> Text
+ if lang is None:
+ return _("English")
+
alias = lang
for lang_dir in _get_language_dirs():
try:
diff --git a/cmk/gui/wato/__init__.py b/cmk/gui/wato/__init__.py
index 90adb95..179fbd5 100644
--- a/cmk/gui/wato/__init__.py
+++ b/cmk/gui/wato/__init__.py
@@ -12656,7 +12656,7 @@ def select_language(user):
if languages:
active = 'language' in user
forms.section(_("Language"), checkbox = ('_set_lang', active,
'language'))
- default_label = _('Default: %s') %
(cmk.gui.i18n.get_language_alias(config.default_language) or _('English'))
+ default_label = _('Default: %s') %
cmk.gui.i18n.get_language_alias(config.default_language)
html.div(default_label, class_="inherited",
id_="attr_default_language", style= "display: none" if active else
"")
html.open_div(id_="attr_entry_language", style="display:
none" if not active else "")