Oved Ourfali has uploaded a new change for review.

Change subject: WIP core+ui+restapi: putting the session locale in the 
SessionDataContainer
......................................................................

WIP core+ui+restapi: putting the session locale in the SessionDataContainer

This patch adds the locale to the session data container, setting it in
different login paths (Webadmin, User Portal, REST API).

This is a preparation for moving the control on the message translation
from the UI layer to the backend layer.

Change-Id: Idbe5cd33d075d3f10ffc2d1a9c62c310bf28ebc4
Signed-off-by: Oved Ourfali <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LoginUserParameters.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java
M 
backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Challenger.java
M 
backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/SessionUtils.java
M 
backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Validator.java
M 
backend/manager/modules/restapi/interface/common/jaxrs/src/test/java/org/ovirt/engine/api/common/security/auth/ChallengerTest.java
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/security/auth/LoginValidator.java
M 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/security/auth/LoginValidatorTest.java
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/gwtservices/GenericApiGWTService.java
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
M 
frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/FrontendActionTest.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java
17 files changed, 84 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/16/21016/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java
index 8df7f55..ae4b09a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java
@@ -119,6 +119,8 @@
         // Permissions for this user might been changed since last login so
         // update his isAdmin flag accordingly
         updateUserData();
+        // Updating the locale for the session
+        setSessionLocale();
         setSucceeded(true);
     }
 
@@ -136,6 +138,15 @@
         return true;
     }
 
+    protected boolean setSessionLocale() {
+        if (!StringUtils.isEmpty(getParameters().getSessionId())) {
+            
SessionDataContainer.getInstance().setLocale(getParameters().getSessionId(), 
getParameters().getLocale());
+        } else if 
(!SessionDataContainer.getInstance().setUser(getCurrentUser())) {
+            return 
failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING);
+        }
+        return true;
+    }
+
     protected boolean isUserCanBeAuthenticated() {
         boolean authenticated = false;
         DbUser dbUser = SessionDataContainer.getInstance().getUser(false);
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java
index aa8c215..7073319 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java
@@ -18,6 +18,7 @@
 
     private static final String USER_PARAMETER_NAME = "user";
     private static final String PASSWORD_PARAMETER_NAME = "password";
+    private static final String LOCALE_PARAMETER_NAME = "locale";
 
     private static SessionDataContainer dataProviderInstance = new 
SessionDataContainer();
 
@@ -197,6 +198,15 @@
     }
 
     /**
+     * Sets the locale for the given session Id
+     * @param sessionId The session to set
+     * @param locale The locale to set
+     */
+    public final void setLocale(String sessionId, String locale) {
+        SetData(sessionId, LOCALE_PARAMETER_NAME, locale);
+    }
+
+    /**
      * @param sessionId The session to get the user for
      * @param refresh Whether refreshing the session is needed
      * @return The user set for the given {@link #session}
@@ -210,6 +220,11 @@
         return (DbUser) GetData(USER_PARAMETER_NAME, refresh);
     }
 
+    /** @return The locale set in the current session */
+    public String getLocale(boolean refresh) {
+        return (String) GetData(LOCALE_PARAMETER_NAME, refresh);
+    }
+
     /**
      * Sets the password of the user for the current session.
      *
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LoginUserParameters.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LoginUserParameters.java
index 688f192..b01dd3f 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LoginUserParameters.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LoginUserParameters.java
@@ -17,8 +17,10 @@
 
     private VdcActionType _actionType;
 
+    private String _locale;
+
     public LoginUserParameters(String userName, String userPassword, String 
domain, String os, String browser,
-            String clientType) {
+            String clientType, String locale) {
         _actionType = VdcActionType.LoginUser;
         _userName = userName;
         _userPassword = userPassword;
@@ -26,6 +28,7 @@
         _os = os;
         _browser = browser;
         _clientType = clientType;
+        _locale = locale;
     }
 
     public LoginUserParameters() {
@@ -78,4 +81,12 @@
         privateIsAdmin = value;
     }
 
+    public String getLocale() {
+        return _locale;
+    }
+
+    public void setLocale(String value) {
+        _locale = value;
+    }
+
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java
index 12ae3aa..d496c2e 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java
@@ -22,7 +22,6 @@
     private boolean shouldbelogged;
     private DbUser parametersCurrentUser;
     private TransactionScopeOption transctionOption;
-
     private transient CommandExecutionReason executionReason;
 
     /**
diff --git 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Challenger.java
 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Challenger.java
index 119ef03..e685ca2 100644
--- 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Challenger.java
+++ 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Challenger.java
@@ -186,7 +186,12 @@
         if (auth != null && auth.size() != 0) {
             Principal principal = scheme.decode(headers);
             String engineSessionId = SessionUtils.generateEngineSessionId();
-            if (validator == null || validator.validate(principal, 
engineSessionId)) {
+            String localeString = null;
+            List<String> locale = SessionUtils.getHeaderField(headers, 
SessionUtils.SESSION_LOCALE);
+            if (locale != null && locale.size() != 0) {
+                localeString = locale.get(0);
+            }
+            if (validator == null || validator.validate(principal, 
engineSessionId, localeString)) {
                 successful = true;
                 if (httpSession == null && preferPersistentAuth) {
                     httpSession = getCurrentSession(true);
diff --git 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/SessionUtils.java
 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/SessionUtils.java
index cdbafd0..c58769a 100644
--- 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/SessionUtils.java
+++ 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/SessionUtils.java
@@ -20,6 +20,7 @@
     public final static String SESSION_TTL_HEADER_FIELD = "Session-TTL";
     public final static String PERSIST_FIELD_VALUE = "persistent-auth";
     public final static String JSESSIONID_HEADER = "JSESSIONID";
+    public final static String SESSION_LOCALE = "locale";
     private static final Log log = LogFactory.getLog(SessionUtils.class);
 
     /*
diff --git 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Validator.java
 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Validator.java
index 2e4a07d..b90839d 100644
--- 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Validator.java
+++ 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/security/auth/Validator.java
@@ -27,9 +27,11 @@
      * credentials have been decoded.
      *
      * @param principal  the decoded principal
+     * @param sessionId  the session ID
+     * @param sessionLocale     the session Locale
      * @return           true iff dispatch should continue
      */
-    boolean validate(Principal principal, String sessionId);
+    boolean validate(Principal principal, String sessionId, String 
sessionLocale);
 
     Principal validate(String sessionID);
 
diff --git 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/test/java/org/ovirt/engine/api/common/security/auth/ChallengerTest.java
 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/test/java/org/ovirt/engine/api/common/security/auth/ChallengerTest.java
index 4f69296..4e23946 100644
--- 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/test/java/org/ovirt/engine/api/common/security/auth/ChallengerTest.java
+++ 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/test/java/org/ovirt/engine/api/common/security/auth/ChallengerTest.java
@@ -231,7 +231,7 @@
         }
 
         @Override
-        public boolean validate(Principal principal, String sessionId) {
+        public boolean validate(Principal principal, String sessionId, String 
locale) {
             return valid;
         }
 
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/security/auth/LoginValidator.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/security/auth/LoginValidator.java
index 4816433..ff62222 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/security/auth/LoginValidator.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/security/auth/LoginValidator.java
@@ -63,7 +63,7 @@
     }
 
     @Override
-    public boolean validate(Principal principal, String sessionId) {
+    public boolean validate(Principal principal, String sessionId, String 
sessionLocale) {
         if (principal == null) {
             return loginFailureNoAuthType();
         }
@@ -74,7 +74,7 @@
         LoginUserParameters params = new 
LoginUserParameters(principal.getUser(),
                 principal.getSecret(),
                 principal.getDomain(),
-                null, null, null);
+                null, null, null, sessionLocale);
         params.setActionType(VdcActionType.LoginUser);
         sessionHelper.setSessionId(sessionId);
         VdcReturnValueBase ret = 
backend.Login(sessionHelper.sessionize(params));
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/security/auth/LoginValidatorTest.java
 
b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/security/auth/LoginValidatorTest.java
index f2d1b62..cde91ed 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/security/auth/LoginValidatorTest.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/security/auth/LoginValidatorTest.java
@@ -71,7 +71,7 @@
 
     @Test
     public void testLogin() {
-        assertTrue(validator.validate(setUpLoginExpectations(true, true), 
sessionId));
+        assertTrue(validator.validate(setUpLoginExpectations(true, true), 
sessionId, null));
     }
 
     @Test
@@ -88,12 +88,12 @@
 
     @Test
     public void testLoginCantDo() {
-        assertFalse(validator.validate(setUpLoginExpectations(false, false), 
sessionId));
+        assertFalse(validator.validate(setUpLoginExpectations(false, false), 
sessionId, null));
     }
 
     @Test
     public void testLoginfailed() {
-        assertFalse(validator.validate(setUpLoginExpectations(true, false), 
sessionId));
+        assertFalse(validator.validate(setUpLoginExpectations(true, false), 
sessionId, null));
     }
 
     @Test
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
index c8797fc..92b9483 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
@@ -787,14 +787,16 @@
      * @param userName The name of the user.
      * @param password The password of the user.
      * @param domain The domain to check for the user.
+     * @param locale The locale in the current session.
      * @param callback The callback to call when the operation is finished.
      */
     public static void LoginAsync(final String userName,
             final String password,
             final String domain,
+            final String locale,
             final AsyncQuery callback) {
         GenericApiGWTServiceAsync service = 
GenericApiGWTServiceAsync.Util.getInstance();
-        LoginAsync(userName, password, domain, callback, service);
+        LoginAsync(userName, password, domain, locale, callback, service);
     }
 
     /**
@@ -802,17 +804,19 @@
      * @param userName The name of the user.
      * @param password The password of the user.
      * @param domain The domain to check for the user.
+     * @param locale The locale in the current session.
      * @param callback The callback to call when the operation is finished.
      * @param service The service to call.
      */
     static void LoginAsync(final String userName,
             final String password,
             final String domain,
+            final String locale,
             final AsyncQuery callback,
             final GenericApiGWTServiceAsync service) {
         logger.finer("Frontend: Invoking async Login."); //$NON-NLS-1$
 
-        service.Login(userName, password, domain, new 
AsyncCallback<VdcReturnValueBase>() {
+        service.Login(userName, password, domain, locale, new 
AsyncCallback<VdcReturnValueBase>() {
             @Override
             public void onSuccess(final VdcReturnValueBase result) {
                 logger.finer("Succesful returned result from Login."); 
//$NON-NLS-1$
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/gwtservices/GenericApiGWTService.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/gwtservices/GenericApiGWTService.java
index 080881f..d69636e 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/gwtservices/GenericApiGWTService.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/gwtservices/GenericApiGWTService.java
@@ -36,5 +36,5 @@
 
     public VdcReturnValueBase logOff(DbUser userToLogoff);
 
-    public VdcReturnValueBase Login(String user, String password, String 
domain);
+    public VdcReturnValueBase Login(String user, String password, String 
domain, String locale);
 }
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
index 7ea939e..a950082 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
@@ -162,8 +162,8 @@
     }
 
     @Override
-    public VdcReturnValueBase Login(String userName, String password, String 
domain) {
-        LoginUserParameters params = new LoginUserParameters(userName, 
password, domain, null, null, null);
+    public VdcReturnValueBase Login(String userName, String password, String 
domain, String locale) {
+        LoginUserParameters params = new LoginUserParameters(userName, 
password, domain, null, null, null, locale);
         params.setSessionId(getSessionId());
         params.setActionType(VdcActionType.LoginAdminUser);
         VdcReturnValueBase returnValue = getBackend().Login(params);
diff --git 
a/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/FrontendActionTest.java
 
b/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/FrontendActionTest.java
index 895a94c..60dc620 100644
--- 
a/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/FrontendActionTest.java
+++ 
b/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/FrontendActionTest.java
@@ -671,8 +671,9 @@
         String testUser = "testUser"; //$NON-NLS-1$
         String testPassword = "testpassword"; //$NON-NLS-1$
         String testDomain = "testdomain"; //$NON-NLS-1$
-        Frontend.LoginAsync(testUser, testPassword, testDomain, 
mockAsyncQuery, mockService);
-        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), callbackAction.capture());
+        String testLocale = "en_US"; //$NON-NLS-1$
+        Frontend.LoginAsync(testUser, testPassword, testDomain, testLocale, 
mockAsyncQuery, mockService);
+        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), eq(testLocale), callbackAction.capture());
         StatusCodeException exception = new StatusCodeException(0, "0 status 
code"); //$NON-NLS-1$
         callbackAction.getValue().onFailure(exception);
         verify(mockFrontendFailureEvent, never()).raise(eq(Frontend.class), 
(EventArgs) any());
@@ -695,10 +696,11 @@
         String testUser = "testUser"; //$NON-NLS-1$
         String testPassword = "testpassword"; //$NON-NLS-1$
         String testDomain = "testdomain"; //$NON-NLS-1$
+        String testLocale = "en_US"; //$NON-NLS-1$
         Frontend.initLoggedInUser(new DbUser(), testPassword);
         when(mockAsyncQuery.isHandleFailure()).thenReturn(Boolean.TRUE);
-        Frontend.LoginAsync(testUser, testPassword, testDomain, 
mockAsyncQuery, mockService);
-        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), callbackAction.capture());
+        Frontend.LoginAsync(testUser, testPassword, testDomain, testLocale, 
mockAsyncQuery, mockService);
+        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), eq(testLocale), callbackAction.capture());
         StatusCodeException exception = new 
StatusCodeException(HttpServletResponse.SC_NOT_FOUND, "404 status code"); 
//$NON-NLS-1$
         callbackAction.getValue().onFailure(exception);
         verify(mockEventsHandler).runQueryFailed(null);
@@ -724,10 +726,11 @@
         String testUser = "testUser"; //$NON-NLS-1$
         String testPassword = "testpassword"; //$NON-NLS-1$
         String testDomain = "testdomain"; //$NON-NLS-1$
+        String testLocale = "en_US"; //$NON-NLS-1$
         Frontend.initLoggedInUser(new DbUser(), testPassword);
         when(mockAsyncQuery.isHandleFailure()).thenReturn(Boolean.TRUE);
-        Frontend.LoginAsync(testUser, testPassword, testDomain, 
mockAsyncQuery, mockService);
-        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), callbackAction.capture());
+        Frontend.LoginAsync(testUser, testPassword, testDomain, testLocale, 
mockAsyncQuery, mockService);
+        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), eq(testLocale), callbackAction.capture());
         VdcReturnValueBase returnValue = new VdcReturnValueBase();
         returnValue.setSucceeded(true);
         callbackAction.getValue().onSuccess(returnValue);
@@ -753,10 +756,11 @@
         String testUser = "testUser"; //$NON-NLS-1$
         String testPassword = "testpassword"; //$NON-NLS-1$
         String testDomain = "testdomain"; //$NON-NLS-1$
+        String testLocale = "en_US"; //$NON-NLS-1$
         Frontend.initLoggedInUser(new DbUser(), testPassword);
         when(mockAsyncQuery.isHandleFailure()).thenReturn(Boolean.TRUE);
-        Frontend.LoginAsync(testUser, testPassword, testDomain, 
mockAsyncQuery, mockService);
-        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), callbackAction.capture());
+        Frontend.LoginAsync(testUser, testPassword, testDomain, testLocale, 
mockAsyncQuery, mockService);
+        verify(mockService).Login(eq(testUser), eq(testPassword), 
eq(testDomain), eq(testLocale), callbackAction.capture());
         VdcReturnValueBase returnValue = new VdcReturnValueBase();
         returnValue.setSucceeded(false); // Yes I know this is the default, 
just to be sure.
         callbackAction.getValue().onSuccess(returnValue);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
index 69d6992..df8bcf3 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
@@ -29,16 +29,21 @@
             + "docs/manual"; //$NON-NLS-1$
 
     private static String documentationLangPath;
+    private static String currentLocale;
 
     public static String getDocumentationLangPath() {
         return documentationLangPath;
+    }
+
+    public static String getCurrentLocale() {
+        return currentLocale;
     }
 
     public Configurator() {
         // Set default configuration values
         setSpiceFullScreen(false);
 
-        String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName();
+        currentLocale = LocaleInfo.getCurrentLocale().getLocaleName();
         documentationLangPath = currentLocale.replaceAll("_", "-") + "/"; 
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
         setSpiceVersion(new Version(4, 4));
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java
index d2fa358..bc9607e 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java
@@ -284,6 +284,7 @@
         Frontend.LoginAsync(fullUserName,
                 (String) getPassword().getEntity(),
                 StringHelper.isNullOrEmpty(domain) ? (String) 
getDomain().getSelectedItem() : domain,
+                getConfigurator().getCurrentLocale(),
                 _asyncQuery);
     }
 
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java
index e9aab61..4075133 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalLoginModel.java
@@ -199,7 +199,8 @@
                 (String) getPassword().getEntity(),
                 (String) getDomain().getSelectedItem(), "", //$NON-NLS-1$
                 "", //$NON-NLS-1$
-                ""), //$NON-NLS-1$
+                "",
+                getConfigurator().getCurrentLocale()), //$NON-NLS-1$
                 new IFrontendActionAsyncCallback() {
                     @Override
                     public void executed(FrontendActionAsyncResult result) {


-- 
To view, visit http://gerrit.ovirt.org/21016
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbe5cd33d075d3f10ffc2d1a9c62c310bf28ebc4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to