01/01: translate poll form
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 06f0345f6a6efd146480bd99fa2301eac7fcf8a9 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue Jun 3 17:19:38 2014 +0200 translate poll form --- pollen-ui-angular/src/main/webapp/i18n/en.js | 23 +++++++++++++++ pollen-ui-angular/src/main/webapp/i18n/fr.js | 24 +++++++++++++++- .../src/main/webapp/js/controllers/pollCtrl.js | 14 ++++++--- .../src/main/webapp/partials/big-poll.html | 8 +++--- .../src/main/webapp/partials/inline-poll.html | 10 +++---- .../src/main/webapp/partials/poll-comment.html | 6 ++-- .../src/main/webapp/partials/poll-popupChoice.html | 2 +- .../src/main/webapp/partials/poll.html | 33 +++++++++++----------- 8 files changed, 85 insertions(+), 35 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index a0b879e..b44924c 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -30,11 +30,34 @@ var translateEN = { 'user.error.mail.empty' : 'E-mail can not be empty', 'user.error.login' : 'Error in e-mail or password', +'poll.tab.vote' : 'Vote', +'poll.tab.comment' : 'Comment', +'poll.tab.result' : 'Result', +'poll.tab.create' : 'Create', +'poll.tab.edit' : 'Edit', +'poll.tab.conf' : 'Configuration', + +'poll.edit' : 'Click to edit', +'poll.desc' : 'Description is optional. This message will not visible in vote page.', +'poll.saved' : 'Poll saved.', + +'vote.added' : 'Vote added.', + +'comment' : 'Comment', +'comment.added' : 'Comment added.', + + 'action.logout' : 'Logout', 'action.login' : 'Login', 'action.register' : 'Register', 'action.recovered' : 'Recovered', 'action.send' : 'Send', +'action.return' : 'Return', +'action.save' : 'Save', +'action.delete' : 'Delete', +'action.vote' : 'Vote', + +'dateFormat' : 'MM-dd-yy', } diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index 6fe7c64..c7a2022 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -30,11 +30,33 @@ var translateFR = { 'user.error.mail.empty' : 'Courriel ne peux pas être vide', 'user.error.login' : 'Erreur sur le nom d\'utilisateur ou le mot de passe', +'poll.tab.vote' : 'Voter', +'poll.tab.comment' : 'Commenter', +'poll.tab.result' : 'Résultat', +'poll.tab.create' : 'Créer', +'poll.tab.edit' : 'Éditer', +'poll.tab.conf' : 'Configuration', + +'poll.edit' : 'Clique pour éditer', +'poll.desc' : 'Description (Facultatif). Ce cadre disparait si aucune description n\'est mise', +'poll.saved' : 'Sondage sauvegardé', + +'vote.added' : 'Vote effectué', + +'comment' : 'Commentaire', +'comment.added' : 'Commentaire effectué', + 'action.logout' : 'Deconnexion', 'action.login' : 'Connexion', 'action.register' : 'S\'enregistrer', 'action.recovered' : 'Récupéré', -'action.send' : 'envoyé', +'action.send' : 'Envoyé', +'action.return' : 'Retour', +'action.save' : 'Sauvegarder', +'action.delete' : 'Supprimer', +'action.vote' : 'Voter', + +'dateFormat' : 'dd/MM/yyyy', } 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 58d2b38..40bb888 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -23,8 +23,8 @@ angular.module('pollControllers', []) }]) .controller('PollCtrl', - ['$scope', '$controller', '$sce', '$timeout', '$routeParams', '$location', 'SessionStorage', - function ( $scope, $controller, $sce, $timeout, $routeParams, $location, SessionStorage) { + ['$scope', '$controller', '$sce', '$timeout', '$routeParams', '$location', 'SessionStorage', '$translate', + function ( $scope, $controller, $sce, $timeout, $routeParams, $location, SessionStorage, $translate) { $scope.setTab = function (defaultValue) { if (angular.isDefined($routeParams.tab)) { return $routeParams.tab; @@ -85,6 +85,10 @@ angular.module('pollControllers', []) } } + $translate('dateFormat').then(function (dateFormat) { + $scope.globalVariables.dateFormat = dateFormat; + }); + $scope.data = {}; $scope.data.poll = {}; @@ -187,7 +191,8 @@ angular.module('pollControllers', []) controller : PollPopChoiceCtrl, resolve : { title : function () { return title;}, - choice : function () { return choice;} + choice : function () { return choice;}, + dateFormat : function () { return $scope.globalVariables.dateFormat;} } }); @@ -203,9 +208,10 @@ angular.module('pollControllers', []) } - var PollPopChoiceCtrl = function ($scope, $modalInstance, title, choice) { + var PollPopChoiceCtrl = function ($scope, $modalInstance, title, choice, dateFormat) { $scope.title = title; $scope.choice = choice; + $scope.dateFormat = dateFormat; var oldChoice = angular.copy(choice); diff --git a/pollen-ui-angular/src/main/webapp/partials/big-poll.html b/pollen-ui-angular/src/main/webapp/partials/big-poll.html index 66c5901..c26b877 100644 --- a/pollen-ui-angular/src/main/webapp/partials/big-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/big-poll.html @@ -38,11 +38,11 @@ <div ng-if="choice.choiceType == 'DATE'"> <h3 edit-me="showEdit" ng-hide="showEdit || isOpen" ng-mouseenter="showEditHover = true" ng-mouseleave="showEditHover = false"> <button class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)">...</button> - {{choice.date | date:'dd/MM/yyyy'}} + {{choice.date | date:globalVariables.dateFormat}} </h3> <h3 ng-show="showEdit || isOpen"> <input type="text" ng-model="choice.date" - datepicker-popup="dd/MM/yyyy" + datepicker-popup="{{globalVariables.dateFormat}}" is-open="isOpen" focus-me="showEdit" ng-exit="showEdit = false" @@ -70,6 +70,6 @@ </div> <div class="pollBigVote"> - <input type="text" placeholder="Votre Nom" ng-model="data.vote.voterName"/> - <button class="btn btn-primary" ng-click="voter()">Voter</button> + <input type="text" placeholder="{{ 'user.name' | translate }}" ng-model="data.vote.voterName"/> + <button class="btn btn-primary" ng-click="voter()">{{ 'action.vote' | translate }}</button> </div> \ No newline at end of file diff --git a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html index 528aab7..0b0b620 100644 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html @@ -28,7 +28,7 @@ <td ng-repeat="choice in data.choices" class="pollChoice pollAnim" ng-mouseenter="showEditHover = true" ng-mouseleave="showEditHover = false"> <div ng-if="choice.choiceType == 'TEXT'" edit-me="showEdit" > <div ng-hide="showEdit && !globalVariables.voted" class="fixe-input" title="{{choice.description}}"> - {{choice.name || 'click pour éditer'}} + {{choice.name || 'poll.edit' | translate}} <info-error error="choice.restError.name[0]" data="choice.name"></info-error> <input type="button" class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)" value="..."/></div> <div ng-show="showEdit && !globalVariables.voted"> @@ -37,9 +37,9 @@ </div> </div> <div ng-if="choice.choiceType == 'DATE'" edit-me="showEdit" > - <div ng-hide="!globalVariables.voted && showEdit || isOpen" class="fixe-input" title="{{choice.description}}">{{choice.date | date:'dd/MM/yyyy'}} <input type="button" class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)" value="..."/></div> + <div ng-hide="!globalVariables.voted && showEdit || isOpen" class="fixe-input" title="{{choice.description}}">{{choice.date | date:globalVariables.dateFormat}} <input type="button" class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)" value="..."/></div> <div ng-show="!globalVariables.voted && showEdit || isOpen" > - <input type="text" class="form-control" ng-model="choice.date" focus-me="showEdit" datepicker-popup="dd/MM/yyyy" is-open="isOpen" ng-exit="showEdit = false" ng-click="isOpen = true" auto-save="saveChoice(choice)" required/> + <input type="text" class="form-control" ng-model="choice.date" focus-me="showEdit" datepicker-popup="{{globalVariables.dateFormat}}" is-open="isOpen" ng-exit="showEdit = false" ng-click="isOpen = true" auto-save="saveChoice(choice)" required/> <input type="button" class="btn btn-default" data-toggle="modal" data-target="#popupAddChoice" ng-click="editChoice(choice)" value="..."/> </div> </div> @@ -51,14 +51,14 @@ <!-- begin input vote --> <tr ng-show="!globalVariables.editMode"> <td class="pollChoice"> - <input type="text" class="form-control" placeholder="votre nom" ng-model="data.vote.voterName" /> + <input type="text" class="form-control" placeholder="{{ 'user.name' | translate }}" ng-model="data.vote.voterName" /> <info-error error="data.vote.restError.voterName[0]" data="data.vote.voteName"></info-error> </td> <td ng-repeat="choice in data.vote.choice" class="pollChoice"> <input type="checkbox" name="{{choice.choiceId}}" ng-model="choice.voteValue" /> </td> <td> - <input class="btn btn-primary btn-large" type="button" value="Vote" ng-click="voter()" /> + <input class="btn btn-primary btn-large" type="button" value="{{ 'action.vote' | translate }}" ng-click="voter()" /> </td> </tr> <!-- end input vote --> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html index 2dd295d..a519b13 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html @@ -24,7 +24,7 @@ <!-- begin for add comment --> <form ng-submit="postComment()"> <div class="form-group"> - <label class="col-sm-2"> Nom </label> + <label class="col-sm-2"> {{ 'user.name' | translate }} </label> <div class="col-sm-1"> <info-error error="restError['author.name'][0]" data="comment.authorName"></info-error> </div> @@ -34,7 +34,7 @@ </div> <div class="form-group"> - <label class="col-sm-2"> Commentaire </label> + <label class="col-sm-2"> {{ 'comment' | translate }} </label> <div class="col-sm-1"><info-error error="restError.text[0]" data="comment.text"></info-error></div> <div class="col-sm-9"> <textarea data-ck-editor ng-model="comment.text"></textarea> @@ -42,7 +42,7 @@ </div> <div class="form-group"> - <button type="submit" class="btn btn-primary" ng-click="postComment()">Commenter</button> + <button type="submit" class="btn btn-primary" ng-click="postComment()">{{ 'action.comment' | translate }}</button> </div> </form> <!-- end form comment --> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html b/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html index a2d05ce..f7abff3 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html @@ -49,7 +49,7 @@ <div class="col-sm-6"> <div class="right-inner-addon "> <i class="glyphicon glyphicon-calendar glyphicon-input"></i> - <input id="popNameChoiceDate" class="form-control" datepicker-popup="dd/MM/yyyy" type="text" ng-model="choice.date" is-open="opened" ng-click="opened = true" focus-me="choice.choiceType == 'DATE'"/> + <input id="popNameChoiceDate" class="form-control" datepicker-popup="{{dateFormat}}" type="text" ng-model="choice.date" is-open="opened" ng-click="opened = true" focus-me="choice.choiceType == 'DATE'"/> </div> </div> </div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll.html b/pollen-ui-angular/src/main/webapp/partials/poll.html index e3af305..9f17f2e 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll.html @@ -20,18 +20,18 @@ --> <form class="form-horizontal" novalidate> <alert type="danger" class="alert-float" ng-if="restError.choice" close="restError.choice = false"> {{restError.choice[0]}} </alert> - <alert type="success" class="alert-float" ng-if="globalVariables.editMode && globalVariables.saved" close="globalVariables.saved = false"> Sondage sauvegardé..</alert> - <alert type="success" class="alert-float" ng-if="globalVariables.voteMode && globalVariables.saved" close="globalVariables.saved = false"> Vote effectué..</alert> - <alert type="success" class="alert-float" ng-if="globalVariables.commentMode && globalVariables.saved" close="globalVariables.saved = false"> Commentaire effectué..</alert> + <alert type="success" class="alert-float" ng-if="globalVariables.editMode && globalVariables.saved" close="globalVariables.saved = false">{{ 'poll.saved' | translate }}</alert> + <alert type="success" class="alert-float" ng-if="globalVariables.voteMode && globalVariables.saved" close="globalVariables.saved = false">{{ 'vote.added' | translate }}</alert> + <alert type="success" class="alert-float" ng-if="globalVariables.commentMode && globalVariables.saved" close="globalVariables.saved = false">{{ 'comment.added' | translate }}</alert> <ul class="nav nav-tabs"> <li ng-class="{active: tab == 'home'}"><a href="{{urlTab}}tab=home"> <span class="glyphicon glyphicon-home"></span> </a></li> - <li ng-class="{active: tab == 'vote'}" ng-show="data.poll.id"><a href="{{globalVariables.linkVote}}">Voter</a></li> - <li ng-class="{active: tab == 'comment'}" ng-show="data.poll.id"><a href="{{globalVariables.linkComment}}">Commenter</a></li> - <li ng-class="{active: tab == 'result'}" ng-show="!globalVariables.create"><a href="{{globalVariables.linkResult}}">Résultat</a></li> - <li ng-class="{active: tab == 'edit'}" ng-show="globalVariables.create"><a href="#/poll/create">Créer</a></li> - <li ng-class="{active: tab == 'edit'}" ng-show="data.poll.permission"><a href="{{globalVariables.linkEdit}}">Editer</a></li> - <li ng-class="{active: tab == 'conf'}" ng-show="data.poll.permission || globalVariables.create"><a href="{{urlTab}}tab=conf">Configuration</a></li> + <li ng-class="{active: tab == 'vote'}" ng-show="data.poll.id"><a href="{{globalVariables.linkVote}}">{{ 'poll.tab.vote' | translate }}</a></li> + <li ng-class="{active: tab == 'comment'}" ng-show="data.poll.id"><a href="{{globalVariables.linkComment}}">{{ 'poll.tab.comment' | translate }}</a></li> + <li ng-class="{active: tab == 'result'}" ng-show="!globalVariables.create"><a href="{{globalVariables.linkResult}}">{{ 'poll.tab.result' | translate }}</a></li> + <li ng-class="{active: tab == 'edit'}" ng-show="globalVariables.create"><a href="#/poll/create">{{ 'poll.tab.create' | translate }}</a></li> + <li ng-class="{active: tab == 'edit'}" ng-show="data.poll.permission"><a href="{{globalVariables.linkEdit}}">{{ 'poll.tab.edit' | translate }}</a></li> + <li ng-class="{active: tab == 'conf'}" ng-show="data.poll.permission || globalVariables.create"><a href="{{urlTab}}tab=conf">{{ 'poll.tab.conf' | translate }}</a></li> </ul> <div ng-include="'partials/poll-link.html'" ng-if="tab == 'home'"></div> @@ -39,7 +39,7 @@ <div ng-if="tab == 'edit' || tab == 'vote'"> <div class="pollTitle" edit-me="showEditTitle"> <h1 ng-hide="showEditTitle"> - {{data.poll.title || 'Click pour éditer'}} + {{data.poll.title || 'poll.edit' | translate }} <info-error error="restError.title[0]" data="data.poll.title"></info-error> </h1> @@ -49,14 +49,15 @@ </div> <div ng-hide="showEditDesc || !globalVariables.editMode && !data.poll.description " class="pollDesc" edit-me="showEditDesc"> - <div ng-bind-html="toHTML(data.poll.description || 'Description (Facultatif). Ce cadre disparait si aucune description n\'est mise')"></div> + <div ng-bind-html="toHTML(data.poll.description)"></div> + <div ng-hide="data.poll.description ">{{ 'poll.desc' | translate }}</div> </div> <div ng-show="showEditDesc" class="pollDesc"> <textarea id="descEditor" data-ck-editor ng-model="data.poll.description"></textarea> <!-- fix me : no save in creation but save in edition --> - <input type="button" value="Return" class="btn btn-primary" ng-click="showEditDesc = false;" ng-show="globalVariables.create"/> - <input type="button" value="Return" class="btn btn-primary" ng-click="showEditDesc = false; savePoll()" ng-show="globalVariables.edit"/> + <button type="button" class="btn btn-primary" ng-click="showEditDesc = false;" ng-show="globalVariables.create">{{ 'action.return' | translate }}</button> + <button type="button" class="btn btn-primary" ng-click="showEditDesc = false; savePoll()" ng-show="globalVariables.edit">{{ 'action.return' | translate }}</button> </div> <div id="poll"> @@ -67,14 +68,12 @@ <div ng-if="globalVariables.create"> <hr/> - <button type="button" class="btn btn-default" ng-model="globalVariables.editMode" btn-checkbox>Mode Edition</button> - <button class="btn btn-primary" ng-click="savePoll()">Sauvegarder</button> + <button class="btn btn-primary" ng-click="savePoll()">{{ 'action.save' | translate }}</button> </div> <div ng-if="globalVariables.edit"> <hr/> - <button type="button" class="btn btn-default" ng-model="globalVariables.editMode" btn-checkbox>Mode Edition</button> - <button class="btn btn-danger" ng-click="deletePoll();">Supprimer</button> + <button class="btn btn-danger" ng-click="deletePoll();">{{ 'action.delete' | translate }}</button> </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