Module: check_mk
Branch: master
Commit: 6ef81c702d2903fba286a18e10bd3e6972dd1862
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6ef81c702d2903…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 3 12:58:59 2012 +0200
FIX: fixed exception when refering to a language which does not exist
---
.bugs/781 | 7 +++++--
ChangeLog | 1 +
web/htdocs/lib.py | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/.bugs/781 b/.bugs/781
index efd7c29..807a4f2 100644
--- a/.bugs/781
+++ b/.bugs/781
@@ -1,9 +1,9 @@
Title: Setting default_language = "de" in multisite.mk breaks all
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-07-02 13:55:03
Targetversion: 1.2.0
-Class: bug
Try: set default_language = "de" in multisite.mk. But do not
provide a language file. The result is an exception:
@@ -20,3 +20,6 @@ Traceback (most recent call last):
NameError: global name 'config' is not defined
[URL to this frame] [URL to this page including sidebar]
+
+2012-07-03 12:57:56: changed state open -> done
+The inline comment was correct, but the code was wrong. Fixed it.
diff --git a/ChangeLog b/ChangeLog
index 93837a1..467439e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@
* FIX: fix problem in showing exceptions (due to help function)
* FIX: fixed several localization problems in view/command processing
* FIX: fixed duplicated settings in WATO when using localisation
+ * FIX: fixed exception when refering to a language which does not exist
WATO:
* Main menu of ruleeditor (Host & Service Parameters) now has
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index f1298fc..5b8c253 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -193,7 +193,7 @@ def load_language(lang):
except IOError, e:
# Fallback to non localized multisite
# I'd prefer to fallback to multisite default language but can not import
config module here
- __builtin__.current_language = config.default_language
+ __builtin__.current_language = None
else:
# Replace the _() function to disable i18n again
__builtin__._ = lambda x: x