Module: check_mk
Branch: master
Commit: 924abac082fa8bbd698d3742cae0e642dc481cd5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=924abac082fa8b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 11:34:36 2013 +0100
FIX Modified languages (via local hierarchy) were listed twice
Localization files which were overridden via files in the local-hierarchy of OMD
were listed twice in the user profile dialog. This has been fixed now.
---
.werks/328 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/lib.py | 8 ++++----
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/.werks/328 b/.werks/328
new file mode 100644
index 0000000..fa221d4
--- /dev/null
+++ b/.werks/328
@@ -0,0 +1,9 @@
+Title: Modified languages (via local hierarchy) were listed twice
+Level: 1
+Component: wato
+Version: 1.2.4b1
+Date: 1387189997
+Class: fix
+
+Localization files which were overridden via files in the local-hierarchy of OMD
+were listed twice in the user profile dialog. This has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index e85c337..0ba1bd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* 0242 FIX: Parameters for clustered services can now be configured on the cluster
host...
* 0309 FIX: Trying to prevent read/write conflicts with a large user base...
* 0311 FIX: Fixed "Inventory failed" message when trying an inventory on
clusters via WATO...
+ * 0328 FIX: Modified languages (via local hierarchy) were listed twice...
Notifications:
* 0108 FIX: Prevent service notification on host alerts...
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 3994f6d..ca826af 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -180,18 +180,18 @@ def get_languages():
# Add the hard coded english language to the language list
# It must be choosable even if the administrator changed the default
# language to a custom value
- languages = [ (None, _('English')) ]
+ languages = set([ (None, _('English')) ])
for lang_dir in get_language_dirs():
try:
- languages += [ (val, get_language_alias(val))
- for val in os.listdir(lang_dir) if not '.' in val ]
+ languages.update([ (val, get_language_alias(val))
+ for val in os.listdir(lang_dir) if not '.' in val ])
except OSError:
# Catch "OSError: [Errno 2] No such file or
# directory:" when directory not exists
pass
- return languages
+ return list(languages)
def load_language(lang):
# Make current language globally known to all of our modules