This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 833886ee87cda4372bb052d0a5180a98310a8cc0 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue Jun 24 17:12:13 2014 +0200 translate result page --- pollen-ui-angular/src/main/webapp/i18n/en.js | 5 +++++ pollen-ui-angular/src/main/webapp/i18n/fr.js | 5 +++++ pollen-ui-angular/src/main/webapp/index.html | 2 +- .../src/main/webapp/js/controllers/localeCtrl.js | 1 + pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js | 9 ++++++++- pollen-ui-angular/src/main/webapp/partials/poll-result.html | 11 +++++++---- 6 files changed, 27 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 a6264ca..e5b1e54 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -58,6 +58,11 @@ var translateEN = { 'poll.restricted.restricted' : 'Restricted', 'poll.restricted.group' : 'Group', 'poll.restricted.pollType' : 'Who can vote ?', +'poll.result.choice' : 'Choice', +'poll.result.score' : 'Score', +'poll.result.title.zero' : 'No result', +'poll.result.title.one' : 'Result : One voter', +'poll.result.title.other' : 'Result : {{nbVoter}} Voters', 'vote.added' : 'Vote added.', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index e0ffabb..b85c1f2 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -58,6 +58,11 @@ var translateFR = { 'poll.restricted.restricted' : 'Restreint', 'poll.restricted.group' : 'Groupe', 'poll.restricted.pollType' : 'Qui peut voter ?', +'poll.result.choice' : 'Choix', +'poll.result.score' : 'Score', +'poll.result.title.zero' : 'Aucun Résultat', +'poll.result.title.one' : 'Résultat : Un votant', +'poll.result.title.other' : 'Résultat : {{nbVoter}} Votants', 'vote.added' : 'Vote effectué', diff --git a/pollen-ui-angular/src/main/webapp/index.html b/pollen-ui-angular/src/main/webapp/index.html index 894c59e..60b2aa9 100644 --- a/pollen-ui-angular/src/main/webapp/index.html +++ b/pollen-ui-angular/src/main/webapp/index.html @@ -69,7 +69,7 @@ <ul class="dropdown-menu"> <li><a ng-click="switchLocale('fr')"><img src="img/fr.png" /> Français </a></li> <li><a ng-click="switchLocale('en')"><img src="img/en.png" /> English </a> </li> - <li><a ng-click="switchLocale('no')"> No Translate </a> </li> + <li ng-if="debug"><a ng-click="switchLocale('no')"> No Translate </a> </li> </ul> </li> </ul> diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js index 960b086..d370ab8 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js @@ -20,6 +20,7 @@ */ angular.module('localeControllers', []) .controller('LocaleCtrl', ['$scope', '$translate', 'SessionStorage',function ($scope, $translate, SessionStorage) { + $scope.debug = conf.debug; $scope.locale = SessionStorage.get().locale; if (angular.isUndefined($scope.locale)) { // set locale with browser preference diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index b2e399e..6987f95 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -975,9 +975,16 @@ angular.module('pollControllers', []) }]) -.controller('PollResultCtrl', ['$scope', '$q', '$controller', '$routeParams', 'Poll', 'PollChoice', 'PollVote', function ($scope, $q, $controller, $routeParams, Poll, PollChoice, PollVote) { +.controller('PollResultCtrl', ['$scope', '$q', '$controller', '$routeParams', 'Poll', 'PollChoice', 'PollVote', '$translate', + function ($scope, $q, $controller, $routeParams, Poll, PollChoice, PollVote, $translate) { $controller('PollCtrl', {$scope:$scope}); + $scope.translateTitle = { + '0' : "{{ 'poll.result.title.zero' | translate }}", + 'one' : "{{ 'poll.result.title.one' | translate }}", + 'other' : "{{ 'poll.result.title.other' | translate:{nbVoter:data.result.nbVotant} }}", + }; + $scope.tab = $scope.setTab('result'); $scope.plot = 'chart'; diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-result.html b/pollen-ui-angular/src/main/webapp/partials/poll-result.html index fb492d4..47af606 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-result.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-result.html @@ -1,7 +1,8 @@ <h1>{{data.poll.title}}</h1> -<h2> Résultats : {{data.result.nbVotant}} Votants</h2> +<h2> <ng-pluralize count="data.result.nbVotant" when="translateTitle"></ng-pluralize> </h2> +<div ng-if="data.result.nbVotant > 0"> <hr/> <div> @@ -19,8 +20,8 @@ <hr/> <table class="table-result"> <tr> - <th>Choix</th> - <th>Score</th> + <th>{{ 'poll.result.choice' | translate }}</th> + <th>{{ 'poll.result.score' | translate }}</th> </tr> <tr ng-repeat="score in data.result.scores"> <th> {{score.choice.name}} </th> @@ -28,4 +29,6 @@ {{score.scoreValue}} </td> </tr> -</table> \ No newline at end of file +</table> + +</div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.