Module: check_mk
Branch: master
Commit: be468317793ca57e2f8ef7d8fbe0ef83444d5901
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be468317793ca5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Mar 30 11:31:33 2013 +0100
FIX: fix localization in non-OMD environment
---
ChangeLog | 4 ++++
web/htdocs/lib.py | 13 ++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 942ee07..3677f76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,10 @@
(Thanks to Mathias Decker)
* check_http: now support the option -L (urlizing the result)
+ Multisite:
+ * FIX: fix localization in non-OMD environment
+ (thanks to あきら)
+
Notifications:
* FIX: fix event type for recoveries
* FIX: fix custom notifications on older nagios versions
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 180c6a7..96c5411 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -191,11 +191,14 @@ def load_language(lang):
if lang:
locale_base = defaults.locale_dir
- local_locale_path = defaults.omd_root + "/local/share/check_mk/locale"
- po_path = '/%s/LC_MESSAGES/multisite.mo' % lang
- # Use file in OMD local strucuture when existing
- if os.path.exists(local_locale_path + po_path):
- locale_base = local_locale_path
+
+ # OMD users can put their localization into a local path into the site
+ if defaults.omd_root:
+ local_locale_path = defaults.omd_root +
"/local/share/check_mk/locale"
+ po_path = '/%s/LC_MESSAGES/multisite.mo' % lang
+ # Use file in OMD local strucuture when existing
+ if os.path.exists(local_locale_path + po_path):
+ locale_base = local_locale_path
try:
i18n = gettext.translation('multisite', locale_base, languages = [
lang ], codeset = 'UTF-8')