Module: check_mk
Branch: master
Commit: 071e2517fb70fd1a5f28442ea78df188391f9ff0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=071e2517fb70fd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 10 11:59:34 2012 +0100
The login mask honors the default_language definition now
---
.bugs/603 | 7 +++++--
.bugs/618 | 7 +++++--
ChangeLog | 1 +
web/htdocs/config.py | 2 +-
web/htdocs/index.py | 4 ++++
5 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/.bugs/603 b/.bugs/603
index 3c41bf2..a5c69c4 100644
--- a/.bugs/603
+++ b/.bugs/603
@@ -1,9 +1,9 @@
Title: default_language not honored by login maski
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-01-25 09:58:35
Targetversion: 1.2.0
-Class: bug
I've translated "Username" and "Password" into 'de'. Then
I've
set default_language = 'de' in multisite.mk. Texts are not
@@ -11,3 +11,6 @@ translated in the Cookie based login form, even after are restart
of Apache. The I login, set my user language to 'de' and logout.
Now the login screen is in German. After a logout the login screen
is in German. Restarting Apache now switches it back to english.
+
+2012-02-10 11:59:32: changed state open -> done
+Has just been implemented.
diff --git a/.bugs/618 b/.bugs/618
index 8bf2335..cf78a5e 100644
--- a/.bugs/618
+++ b/.bugs/618
@@ -1,9 +1,9 @@
Title: Hosts Snapin berücksichtigt Nutzer Berechtigungen nicht
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-01-18 10:25:53
Targetversion: 1.2.0
-Class: bug
Ich habe gerade eine leere Site mit 2 Hosts in 2 Foldern angelegt. Auf den einen ist
der Nutzer berechtigt, auf den anderen nicht. Im Hosts Snapin sehe ich troztem beide
@@ -13,3 +13,6 @@ Lösungsmöglichkeit:
Das Snapin nur noch für die Statusgui Navigation benutzen und dann via Livestatus
Query die Anzahl der Hosts herausfinden.
+
+2012-02-10 11:53:14: changed state open -> done
+Has already been solved. The hosts snapin has been recoded.
diff --git a/ChangeLog b/ChangeLog
index c7feb79..ce9ea0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,7 @@
* Chrome: Fixed styling problem of foldertree snapin
* Views: Only show the commands and row selection options for views where
commands are possible
+ * The login mask honors the default_language definition now
1.1.13i3:
Core, Setup, etc.:
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 13c04e2..8273b6e 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -304,7 +304,7 @@ def login(u):
def get_language(default = None):
if default == None:
default = default_language
- return user.get('language', default)
+ return user and user.get('language', default) or default
def roles_of_user(user):
# Make sure, builtin roles are present, even if not modified
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index d6b0fd3..25916e5 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -240,6 +240,10 @@ def handler(req, profiling = True):
# While api call don't show the login dialog
raise MKUnauthenticatedException(_('You are not
authenticated.'))
+ # Initialize the i18n for the login dialog. This might be overridden
+ # later after user login
+ load_language(html.var("lang", config.get_language()))
+
# After auth check the regular page can be shown
result = login.page_login()
if type(result) == tuple: