01/01: translate error une register and login
This is an automated email from the git hooks/post-receive script. New commit to branch devel in repository pollen. See http://git.chorem.org/pollen.git commit e4791648edeb26c0728235c588d452632b06b6c1 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue Jun 3 10:45:31 2014 +0200 translate error une register and login --- pollen-ui-angular/src/main/webapp/i18n/en.js | 4 ++++ pollen-ui-angular/src/main/webapp/i18n/fr.js | 4 ++++ .../src/main/webapp/js/controllers/userCtrl.js | 16 +++++++++++----- .../src/main/webapp/partials/user-register.html | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index b10797f..a0b879e 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -25,6 +25,10 @@ var translateEN = { 'user.register.success' : 'Register with success', 'user.edit.success' : 'Save with success', 'user.forgotPassword.success' : 'Password send by email', +'user.error.password.diff' : 'Passwords not equal', +'user.error.mail.notFound' : 'E-mail not found', +'user.error.mail.empty' : 'E-mail can not be empty', +'user.error.login' : 'Error in e-mail or password', 'action.logout' : 'Logout', 'action.login' : 'Login', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index 2c9f68f..6fe7c64 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -25,6 +25,10 @@ var translateFR = { 'user.register.success' : 'Compte enregisté, un mail de validation vient d\'être envoyé..', 'user.edit.success' : 'Modification effectuée..', 'user.forgotPassword.success' : 'Un mail de changement de mot de passe vient d\'être envoyé..', +'user.error.password.diff' : 'Mot de passe différent', +'user.error.mail.notFound' : 'Courriel n\'a pas été trouvé', +'user.error.mail.empty' : 'Courriel ne peux pas être vide', +'user.error.login' : 'Erreur sur le nom d\'utilisateur ou le mot de passe', 'action.logout' : 'Deconnexion', 'action.login' : 'Connexion', diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js index e4c8070..d9afb8b 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js @@ -38,7 +38,7 @@ } }]) -.controller('UserLostPasswordCtrl', ['$scope', 'UserLostPassword', function ($scope, UserLostPassword) { +.controller('UserLostPasswordCtrl', ['$scope', '$translate', 'UserLostPassword', function ($scope, $translate, UserLostPassword) { $scope.email = ''; $scope.submit = function () { if ($scope.email != '') { @@ -46,11 +46,15 @@ $scope.saved = true; $scope.email = ''; }, function (error) { - $scope.restError = {email: ["email n'a pas été trouvé"]}; + $translate('user.error.mail.notFound').then(function (error) { + $scope.restError = {email: [error]}; + }) }) } else { - $scope.restError = {email : ["email ne peut pas être vide"]}; + $translate('user.error.mail.empty').then(function (error) { + $scope.restError = {email: [error]}; + }) } } }]) @@ -71,7 +75,7 @@ } }]) -.controller('UserLoginCtrl', ['$scope', 'UserLogin', 'UserLogout', 'User', 'SessionStorage', '$route', '$location', function ($scope, UserLogin, UserLogout, User, SessionStorage, $route, $location) { +.controller('UserLoginCtrl', ['$scope', 'UserLogin', 'UserLogout', 'User', 'SessionStorage', '$route', '$location', '$translate', function ($scope, UserLogin, UserLogout, User, SessionStorage, $route, $location, $translate) { if (angular.isUndefined($scope.data)) { $scope.data = {user:{}}; } @@ -94,7 +98,9 @@ $route.reload(); }) }, function (error) { - $scope.restError = {connexion : "Erreur sur le nom d'utilisateur ou le mot de passe"}; + $translate('user.error.login').then(function (error) { + $scope.restError = {connexion: error}; + }) }); } diff --git a/pollen-ui-angular/src/main/webapp/partials/user-register.html b/pollen-ui-angular/src/main/webapp/partials/user-register.html index 9bd9657..de3c261 100644 --- a/pollen-ui-angular/src/main/webapp/partials/user-register.html +++ b/pollen-ui-angular/src/main/webapp/partials/user-register.html @@ -75,7 +75,7 @@ <input type="password" id="formPassword2" name="password2" class="form-control" ng-model="data.user.password2"/> </div> <div class="col-sm-1"> - <span class="glyphicon glyphicon-exclamation-sign danger" tooltip="Mot de passe différent" ng-if="data.user.password != data.user.password2"></span> + <span class="glyphicon glyphicon-exclamation-sign danger" tooltip="{{ 'user.error.password.diff' | translate }}" ng-if="data.user.password != data.user.password2"></span> </div> </div> -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
Chorem.org scm