translate button fixed

parent 108bffc6
...@@ -53,13 +53,18 @@ function LoginCtrl( ...@@ -53,13 +53,18 @@ function LoginCtrl(
$window.sessionStorage.token = data.token; $window.sessionStorage.token = data.token;
// Adapt language en-us to en-gb (the latter is the one supported for 'en') //User data correct
if (data.user) { if (data.user) {
// Adapt language en-us to en-gb (the latter is the one supported for 'en')
if (data.user.lang === 'en-us') { if (data.user.lang === 'en-us') {
data.user.lang = 'en-gb'; data.user.lang = 'en-gb';
} }
//Update $scope
$scope.lang = data.user.lang; $scope.lang = data.user.lang;
//Update $translate
$translate.use($scope.lang);
} else { } else {
//No user data, use default lang
$translate.use($scope.lang); $translate.use($scope.lang);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment