This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 949faa6a7668b239cc0bc61144022812614175ca Author: Yannick Martel <martel@©odelutin.com> Date: Thu Jan 22 16:37:59 2015 +0100 i18n menu and document part --- coselmar-ui/pom.xml | 6 ++ coselmar-ui/src/main/webapp/i18n/en.js | 80 +++++++++++++++++++++ coselmar-ui/src/main/webapp/i18n/fr.js | 21 ++++++ coselmar-ui/src/main/webapp/img/en.png | Bin 0 -> 599 bytes coselmar-ui/src/main/webapp/img/fr.png | Bin 0 -> 545 bytes coselmar-ui/src/main/webapp/index.html | 52 +++++++++----- .../src/main/webapp/js/coselmar-constants.js | 3 +- .../src/main/webapp/js/coselmar-controllers.js | 35 ++++++++- coselmar-ui/src/main/webapp/js/coselmar.js | 13 +++- .../src/main/webapp/views/documents/documents.html | 22 +++--- .../main/webapp/views/documents/editDocument.html | 44 ++++++------ .../webapp/views/documents/modalDocumentEdit.html | 55 +++++++------- .../views/documents/modalDocumentSearch.html | 17 ++--- .../main/webapp/views/documents/newdocument.html | 64 ++++++++--------- .../main/webapp/views/documents/viewDocument.html | 42 +++++------ pom.xml | 8 +++ 16 files changed, 312 insertions(+), 150 deletions(-) diff --git a/coselmar-ui/pom.xml b/coselmar-ui/pom.xml index 27df992..872db46 100644 --- a/coselmar-ui/pom.xml +++ b/coselmar-ui/pom.xml @@ -79,6 +79,12 @@ <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>angular-translate</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> <build> diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js new file mode 100644 index 0000000..b922b0b --- /dev/null +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -0,0 +1,80 @@ +var translateEN = { + +"application.title" : "Coselmar Platform", + +"menu.item.users" : "Users", +"menu.item.users.list" : "List", +"menu.item.users.add" : "Add an user", +"menu.item.users.add.client" : "Add a client", +"menu.item.questions" : "Questions", +"menu.item.questions.list" : "List", +"menu.item.questions.add" : "Add a question", +"menu.item.documents" : "Documents", +"menu.item.documents.list" : "List", +"menu.item.documents.add" : "Add a document", +"menu.item.referential" : "Referential Search", + +"menu.button.login" : "Sign in", +"menu.button.profile" : "Profile", +"menu.button.logout" : "Logout", + +"document.list.title" : "All documents", +"document.modalSearch.title" : "Search Documents", +"document.button.add" : "Add a document", +"document.message.delete" : "Do you really want to delete this document ?", +"document.create.title" : "New document", +"document.create.info" : "Here you can add a new document in the repository. For each document,\ + some keywords are needed to make easier search of the document, and you\ + can specify a privacy :\ + <ul>\ + <li>Public : all members can see the document</li>\ + <li>Private : only you can see the document</li>\ + <li>Restricted : you can specify who can see the document specifically</li>\ + </ul>", + +"document.metadata.name" : "Title", +"document.metadata.authors" : "Authors", +"document.metadata.privacy" : "Privacy", +"document.metadata.keywords" : "Keywords", +"document.metadata.depositor" : "Depositor", +"document.metadata.depositDate" : "Deposit Date", +"document.metadata.relatedQuestions" : "Related Questions", +"document.metadata.view.relatedQuestions" : "Questions with this document", +"document.metadata.type" : "Type", +"document.metadata.file" : "File", +"document.metadata.externalUrl" : "External URL", +"document.metadata.copyright" : "Copyright", +"document.metadata.licence" : "Licence", +"document.metadata.language" : "Language", +"document.metadata.publicationDate" : "Publication Date", +"document.metadata.summary" : "Summary", +"document.metadata.comment" : "Comment", +"document.metadata.fileName" : "Document File", +"document.metadata.externalLink" : "External Link", + +"document.message.requiredName" : "Document name is required.", +"document.message.requiredType" : "Document type is required.", +"document.message.requiredExternalUrlOrFile" : "A File or an external URL is required.", +"document.message.requiredExternalUrl" : "For this document, an external URL is required.", +"document.message.requiredKeywords" : "At least one keyword is required.", +"document.message.requiredAuthors" : "Document authors is required.", +"document.message.requiredCopyright" : "Document copyright is required.", +"document.message.requiredSummary" : "A summary is required.", +"document.privacy.questionRestricted" : "Restricted to current Question", + +"document.button.download" : "Download", +"document.button.openLink" : "Open link", + +"common.privacy.private" : "Private", +"common.privacy.public" : "Public", +"common.privacy.restricted" : "Restricted", + +"common.button.delete" : "Delete", +"common.button.edit" : "Modify", +"common.button.add" : "Add", +"common.button.cancel" : "Cancel", +"common.message.missingMandatoryFields" : "Some mandatory field (*) have not been filled.", +"common.message.notYetAvailable" : "Not yet available.", +"common.message.mandatoryFieldsInfo" : "Field with <strong><big>*</big></strong> are mandatory.", + +} \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js new file mode 100644 index 0000000..8667b78 --- /dev/null +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -0,0 +1,21 @@ +var translateFR = { + +"application.title" : "Coselmar Plateforme", + +"menu.item.users" : "Utilisateurs", +"menu.item.users.list" : "Liste", +"menu.item.users.add" : "Ajouter un utilisateur", +"menu.item.users.add.client" : "Ajouter un client", +"menu.item.questions" : "Questions", +"menu.item.questions.list" : "Liste", +"menu.item.questions.add" : "Ajouter une question", +"menu.item.documents" : "Documents", +"menu.item.documents.list" : "Liste", +"menu.item.documents.add" : "Ajouter un document", +"menu.item.referential" : "Référentiel", + +"menu.button.login" : "Connexion", +"menu.button.profile" : "Profil", +"menu.button.logout" : "Déconnexion" + +} \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/img/en.png b/coselmar-ui/src/main/webapp/img/en.png new file mode 100644 index 0000000..ff701e1 Binary files /dev/null and b/coselmar-ui/src/main/webapp/img/en.png differ diff --git a/coselmar-ui/src/main/webapp/img/fr.png b/coselmar-ui/src/main/webapp/img/fr.png new file mode 100644 index 0000000..8332c4e Binary files /dev/null and b/coselmar-ui/src/main/webapp/img/fr.png differ diff --git a/coselmar-ui/src/main/webapp/index.html b/coselmar-ui/src/main/webapp/index.html index c7c1808..d3d788d 100644 --- a/coselmar-ui/src/main/webapp/index.html +++ b/coselmar-ui/src/main/webapp/index.html @@ -37,6 +37,7 @@ <script src="webjars/angularjs/1.3.6/angular-messages.js"></script> <!--<script src="nuiton-js/angular-ui-bootstrap.js"></script>--> <script src="webjars/bootstrap/3.3.1/js/bootstrap.js"></script> + <script src="webjars/angular-translate/2.5.2/angular-translate.js"></script> <!--TODO ymartel 20141203 : extract version, or use wro --> <script src="webjars/angular-ui-select/0.9.0/select.js"></script> @@ -45,6 +46,8 @@ <script src="webjars/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.js"></script> <script src="js/angular-jwt.js"></script> + <script src="i18n/en.js"></script> + <script src="i18n/fr.js"></script> <script src="js/coselmar.js"></script> <script src="js/coselmar-constants.js"></script> <script src="js/coselmar-controllers.js"></script> @@ -70,34 +73,34 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand visible-xs" href="#">Coselmar Referential</a> + <a class="navbar-brand visible-xs" href="#" translate="application.title">Coselmar Referential</a> </div> <nav class="hidden-xs"> <ul class="nav navbar-nav"> - <a href="#" role="button" class="navbar-brand">Coselmar Platform</a> + <a href="#" role="button" class="navbar-brand">{{ 'application.title' | translate}}</a> <li class="dropdown" ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR'"> - <a class="dropdown-toggle" data-toggle="dropdown">Users<span class="caret"></span></a> + <a class="dropdown-toggle" data-toggle="dropdown">{{ 'menu.item.users' | translate}}<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> - <li><a href="#/users" role="menuitem">List</a></li> - <li><a href="#/users/new" role="menuitem" ng-if="currentUser.role == 'ADMIN'">Add an user</a></li> - <li><a href="#/users/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">Add a client</a></li> + <li><a href="#/users" role="menuitem">{{ 'menu.item.users.list' | translate}}</a></li> + <li><a href="#/users/new" role="menuitem" ng-if="currentUser.role == 'ADMIN'">{{ 'menu.item.users.add' | translate}}</a></li> + <li><a href="#/users/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">{{ 'menu.item.users.add.client' | translate}}</a></li> </ul> </li> <li ng-if="currentUser"> - <a href="#/documents" role="button" class="dropdown-toggle">Documents</a> + <a href="#/documents" role="button" class="dropdown-toggle">{{ 'menu.item.documents' | translate}}</a> </li> <li class="dropdown" ng-if="currentUser"> - <a class="dropdown-toggle" data-toggle="dropdown">Questions<span class="caret"></span></a> + <a class="dropdown-toggle" data-toggle="dropdown">{{ 'menu.item.questions' | translate}}<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> - <li><a href="#/questions" role="menuitem">List</a></li> - <li><a href="#/questions/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">Add a question</a></li> + <li><a href="#/questions" role="menuitem">{{ 'menu.item.questions.list' | translate}}</a></li> + <li><a href="#/questions/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">{{ 'menu.item.questions.add' | translate}}</a></li> </ul> </li> <li ng-if="currentUser"> - <a href="#/referential" role="button" class="dropdown-toggle">Referential Search</a> + <a href="#/referential" role="button" class="dropdown-toggle">{{ 'menu.item.referential' | translate}}</a> </li> </ul> @@ -109,33 +112,44 @@ <div class="form-group"> <input type="password" placeholder="Password" class="form-control" ng-model="loginPassword"> </div> - <button type="submit" class="btn btn-action" ng-click="login(loginMail, loginPassword)">Sign in</button> + <button type="submit" class="btn btn-action" ng-click="login(loginMail, loginPassword)">{{ 'menu.button.login' | translate}}</button> </form> <form class="navbar-form navbar-right" role="form" ng-if="currentUser"> <div class="form-group">{{currentUser.firstName}} {{currentUser.lastName}} <a href="#/users/{{currentUser.userId}}?edit" class="btn btn-action"> - <span class="glyphicon glyphicon-user" aria-hidden="true"></span>Profile + <span class="glyphicon glyphicon-user" aria-hidden="true"></span>{{ 'menu.button.profile' | translate}} </a> </div> <button type="submit" class="btn btn-action" ng-click="logout()"> - <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span>Logout + <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span>{{ 'menu.button.logout' | translate}} </button> </form> + + <ul class="nav navbar-nav navbar-right"> + <li class="dropdown-toggle"> + <a class="dropdown-toggle" data-toggle="dropdown"> <img ng:attr-src="img/{{locale}}.png" /><span class="caret"></span></a> + <ul class="dropdown-menu" role="menu"> + <li><a ng-click="switchLocale('fr')" role="menuitem"><img src="img/fr.png" /> Français </a></li> + <li><a ng-click="switchLocale('en')" role="menuitem"><img src="img/en.png" /> English </a> </li> + </ul> + </li> + </ul> + </nav> <nav class="visible-xs" collapse="!isCollapsed"> <ul class="nav navbar-nav"> - <li ng-if="currentUser.role == 'ADMIN'"> - <a href="#users" ng-click="isCollapsed = !isCollapsed">Users</a> + <li ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR'"> + <a href="#users" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.users' | translate}}</a> </li> <li ng-if="currentUser"> - <a href="#documents" ng-click="isCollapsed = !isCollapsed">Documents</a> + <a href="#documents" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.documents' | translate}}</a> </li> <li ng-if="currentUser"> - <a href="#question" ng-click="isCollapsed = !isCollapsed">Questions</a> + <a href="#questions" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.questions' | translate}}</a> </li> <li ng-if="currentUser"> - <a href="#referential" ng-click="isCollapsed = !isCollapsed">Referential</a> + <a href="#referential" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.referential' | translate}}</a> </li> </ul> </nav> diff --git a/coselmar-ui/src/main/webapp/js/coselmar-constants.js b/coselmar-ui/src/main/webapp/js/coselmar-constants.js index db0633c..f1ea0b2 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-constants.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-constants.js @@ -22,5 +22,6 @@ * #L% */ coselmarApp.constant('coselmar-config', { - BASE_URL : "http://localhost:8081/services/v1" + BASE_URL : "http://localhost:8081/services/v1", + SUPPORTED_LOCALE : ["en", "fr"] }); \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index a46cd87..8f328e9 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -24,8 +24,8 @@ var coselmarControllers = angular.module('coselmarControllers', ['ui.bootstrap', 'ui.select', 'ui.bootstrap.tooltip']); // Controller when the main page/view loads -coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$routeParams', 'userService', 'jwtHelper', - function ($scope, $http, $location, $routeParams, userService, jwtHelper) { +coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$routeParams', '$locale', '$translate', 'userService', 'jwtHelper', 'coselmar-config', + function ($scope, $http, $location, $routeParams, $locale, $translate, userService, jwtHelper, coselmarConfig) { var jwtToken = localStorage.getItem('coselmar-jwt'); if (jwtToken && !jwtHelper.isTokenExpired(jwtToken)) { @@ -60,6 +60,35 @@ coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$ro $location.path('/'); } + // i18n Management + $scope.locale = localStorage.getItem('coselmar-locale'); + + console.log($scope.locale); + + if (angular.isUndefined($scope.locale)) { + // set locale with browser preference + $scope.locale = navigator.language || navigator.userLanguage; + $scope.locale = $scope.locale.substring(0,2); + + // get locale supported + if (coselmarConfig.SUPPORTED_LOCALE.indexOf($scope.locale) == -1) { + $scope.locale = coselmarConfig.SUPPORTED_LOCALE[0]; + } + + } + $translate.use($scope.locale); + + + $scope.switchLocale = function (locale) { + // switch locale + if (locale != $scope.locale) { + // Store locale in localStorage + localStorage.setItem('coselmar-locale', locale); + $scope.locale = locale; + $translate.use(locale); + } + } + }]); // Controller when got 401 @@ -1186,7 +1215,7 @@ coselmarControllers.directive('ngConfirmClick', ['$modal', function($modal) { var message = attrs.ngConfirmMessage || "Are you sure ?"; var modalHtml = '<div class="modal-title"><h2>Confirm Action</h2></div>'; - modalHtml += '<div class="modal-body">' + message + '</div>'; + modalHtml += '<div class="modal-body"> {{\'' + message + '\' | translate}}</div>'; modalHtml += '<div class="modal-footer"><button class="btn btn-primary" ng-click="ok()">OK</button><button class="btn btn-warning" ng-click="cancel()">Cancel</button></div>'; var modalInstance = $modal.open({ diff --git a/coselmar-ui/src/main/webapp/js/coselmar.js b/coselmar-ui/src/main/webapp/js/coselmar.js index 12e3435..eb3b393 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar.js +++ b/coselmar-ui/src/main/webapp/js/coselmar.js @@ -21,7 +21,8 @@ * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ -var coselmarApp = angular.module("coselmarApp", ['ngRoute', 'ngResource', 'ngMessages', 'angular-jwt', 'coselmarControllers', 'coselmarServices']); +var coselmarApp = angular.module("coselmarApp", ['ngRoute', 'ngResource', 'ngMessages', 'pascalprecht.translate', + 'angular-jwt', 'coselmarControllers', 'coselmarServices']); coselmarApp.config(['$routeProvider', function($routeProvider) { $routeProvider @@ -129,4 +130,14 @@ coselmarApp.config(function($httpProvider) { // edit content-type for send data to the server $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; +}); + +// i18n provider +coselmarApp.config(function($translateProvider) { + // define translations variables + $translateProvider.translations('en', translateEN); + $translateProvider.translations('fr', translateFR); + // defined default + $translateProvider.preferredLanguage('en'); + $translateProvider.fallbackLanguage('en'); }); \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/documents/documents.html b/coselmar-ui/src/main/webapp/views/documents/documents.html index 5fa2d56..9fe4165 100644 --- a/coselmar-ui/src/main/webapp/views/documents/documents.html +++ b/coselmar-ui/src/main/webapp/views/documents/documents.html @@ -25,14 +25,14 @@ <div class="page-header" style="margin: 0"> <h1> <!-- Heading goes here --> - All Documents + {{ 'document.list.title' | translate}} </h1> </div> <div> <div> <div class="form-group" ng-if="currentUser.role == 'EXPERT'"> - <a href="#/documents/new" class="form-inline navbar-left btn btn-primary">Add a document</a> + <a href="#/documents/new" class="form-inline navbar-left btn btn-primary">{{ 'application.title' | translate}}</a> </div> <form class="form-inline pull-right" role="documentOptions" ng-submit="searchDocuments()"> <div class="form-group"> @@ -46,13 +46,13 @@ <br/> <table class="table"> <tr> - <th>Name</th> - <th>Authors</th> - <th>Privacy</th> - <th>Keywords</th> - <th>Depositor</th> - <th>Deposit Date</th> - <th>Related Question</th> + <th>{{ 'document.metadata.name' | translate }}</th> + <th>{{ 'document.metadata.authors' | translate }}</th> + <th>{{ 'document.metadata.privacy' | translate }}</th> + <th>{{ 'document.metadata.keywords' | translate }}</th> + <th>{{ 'document.metadata.depositor' | translate }}</th> + <th>{{ 'document.metadata.depositDate' | translate }}</th> + <th>{{ 'document.metadata.relatedQuestions' | translate }}</th> <th></th> </tr> <tr ng-repeat="document in documents"> @@ -64,9 +64,9 @@ <td>{{document.depositDate | date:'mediumDate'}}</td> <td class="text-center">{{document.relatedQuestions.length || 0}}</td> <td ng-if="currentUser.role == 'ADMIN'"><a class="btn btn-action btn-disable" - ng-confirm-message="Do you really want to delete this document ?" + ng-confirm-message="document.message.delete" ng-confirm-click="deleteDocument(document.id)"> - <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>Delete</a> + <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>{{ 'common.button.delete' | translate }}</a> </td> </tr> </table> diff --git a/coselmar-ui/src/main/webapp/views/documents/editDocument.html b/coselmar-ui/src/main/webapp/views/documents/editDocument.html index af40a5f..7a9df02 100644 --- a/coselmar-ui/src/main/webapp/views/documents/editDocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/editDocument.html @@ -11,7 +11,7 @@ <!-- Line with Title, type and privacy --> <div class="form-group row"> <div ng-class="{'has-error' : documentForm.name.$invalid && !documentForm.name.$pristine}"> - <label class="col-md-2 control-label">Name *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.name' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="name" @@ -19,20 +19,20 @@ ng-model="document.name" required/> <p ng-show="documentForm.name.$invalid && !documentForm.name.$pristine" - class="help-block">Document name is required.</p> + class="help-block">{{ 'document.message.requiredName' | translate }}</p> </div> </div> <div class="" ng-class="{'has-error' : documentForm.type.$invalid && !documentForm.type.$pristine}"> - <label class="col-md-1 control-label">Type *</label> + <label class="col-md-1 control-label">{{ 'document.metadata.type' | translate }} *</label> <div class="col-md-2"> <input type="text" class="form-control" name="type" data-ng-model="document.type" list="existingTypes" required/> <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" - class="help-block">Document type is required.</p> + class="help-block">{{ 'document.message.requiredType' | translate }}</p> </div> <datalist id="existingTypes"> <option data-ng-repeat="type in existing.types" value="{{type}}"> @@ -41,7 +41,7 @@ <div> - <label class="col-md-1 control-label">Privacy</label> + <label class="col-md-1 control-label">{{ 'document.metadata.privacy' | translate }}</label> <div class="col-md-2"> <input type="text" class="form-control" name="type" @@ -56,7 +56,7 @@ && !documentForm.externalUrl.$pristine && !document.fileName}"> <div> - <label class="col-md-2 control-label">File</label> + <label class="col-md-2 control-label">{{ 'document.metadata.file' | translate }}</label> <div class="col-md-4"> <input type="text" class="form-control" name="fileName" @@ -65,7 +65,7 @@ </div> <div> - <label class="col-md-2 control-label">External URL</label> + <label class="col-md-2 control-label">{{ 'document.metadata.externalUrl' | translate }}</label> <div class="col-md-4"> <input type="input" class="form-control" name="externalUrl" @@ -75,7 +75,7 @@ </div> </div> <p ng-show="!document.externalUrl && !documentForm.externalUrl.$pristine && !document.fileName" - class="help-block text-center clear">For this document, an external URL is required.</p> + class="help-block text-center clear">{{ 'document.message.requiredExternalUrl' | translate }}</p> </div> <!-- Line with Keywords --> @@ -83,7 +83,7 @@ <div ng-class="{'has-error' : documentForm.keywords.$invalid && !documentForm.keywords.$pristine}"> - <label class="col-md-2 control-label">keywords *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.keywords' | translate }} *</label> <div class="col-md-2"> <input type="text" class="form-control" name="keywords" @@ -91,7 +91,7 @@ ng-model="toAddKeyword" list="existingKeywords" /> <p ng-show="document.keywords.length < 1 && !documentForm.keywords.$pristine" - class="help-block">At least one keyword is required.</p> + class="help-block">{{ 'document.message.requiredKeywords' | translate }}</p> </div> <datalist id="existingKeywords"> <option data-ng-repeat="keyword in existing.keywords" value="{{keyword}}"> @@ -100,7 +100,7 @@ <div class="col-md-1"> <button class="btn btn-primary" value="add" - ng-click="addKeyword(toAddKeyword); toAddKeyword=''">add</button> + ng-click="addKeyword(toAddKeyword); toAddKeyword=''">{{ 'common.button.add' | translate }}</button> </div> @@ -119,7 +119,7 @@ <div class="form-group"> <div ng-class="{'has-error' : documentForm.authors.$invalid && !documentForm.authors.$pristine}"> - <label class="col-md-2 control-label">Authors *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.authors' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="authors" @@ -127,14 +127,14 @@ ng-model="document.authors" required/> <p ng-show="documentForm.authors.$invalid && !documentForm.authors.$pristine" - class="help-block">Document authors is required.</p> + class="help-block">{{ 'document.message.requiredAuthors' | translate }}</p> </div> </div> <div ng-class="{'has-error' : documentForm.copyright.$invalid && !documentForm.copyright.$pristine}"> - <label class="col-md-2 control-label">Copyright *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.copyright' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="copyright" @@ -142,7 +142,7 @@ ng-model="document.copyright" required/> <p ng-show="documentForm.copyright.$invalid && !documentForm.copyright.$pristine" - class="help-block">Copyright is required.</p> + class="help-block">{{ 'document.message.requiredCopyright' | translate }}</p> </div> </div> </div> @@ -150,7 +150,7 @@ <!-- Line with License, publication date and language --> <div class="form-group"> <div > - <label class="col-md-2 control-label">Licence</label> + <label class="col-md-2 control-label">{{ 'document.metadata.licence' | translate }}</label> <div class="col-md-4"> <input type="text" class="form-control" name="licence" @@ -160,7 +160,7 @@ </div> <div> - <label class="col-md-1 control-label">Language</label> + <label class="col-md-1 control-label">{{ 'document.metadata.language' | translate }}</label> <div class="col-md-1"> <input type="text" class="form-control" name="language" @@ -170,7 +170,7 @@ </div> <div> - <label class="col-md-2 control-label">Publication date</label> + <label class="col-md-2 control-label">{{ 'document.metadata.publicationDate' | translate }}</label> <div class="col-md-2"> <div class="input-group"> @@ -189,7 +189,7 @@ <!-- Summary --> <div class="form-group" ng-class="{'has-error' : documentForm.summary.$invalid && !documentForm.summary.$pristine}"> - <label class="col-md-2 control-label">Summary *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.summary' | translate }} *</label> <div class="col-md-10"> <textarea type="text" class="form-control" name="summary" rows="5" @@ -197,13 +197,13 @@ ng-model="document.summary" required/> <p ng-show="documentForm.summary.$invalid && !documentForm.summary.$pristine" - class="help-block">A summary is required.</p> + class="help-block">{{ 'document.message.requiredSummary' | translate }}</p> </div> </div> <!-- Comment --> <div class="form-group" > - <label class="col-md-2 control-label">Comment</label> + <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> <div class="col-md-10"> <textarea type="text" class="form-control" name="comment" rows="5" @@ -214,7 +214,7 @@ <div class="form-group"> <div ng-if="hasErrors" class="has-error"> - <div class="text-center help-block">Some mandatory fields (*) have not been filled.</div> + <div class="text-center help-block">{{ 'common.message.missingMandatoryFields' | translate }}</div> </div> <div class="float-right col-md-4"> <input type="submit" value="Submit" class="btn btn-action btn-success" diff --git a/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html b/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html index 03920ac..668f4bc 100644 --- a/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html +++ b/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html @@ -23,8 +23,8 @@ --> <div xmlns="http://www.w3.org/1999/html"> <div class="modal-title"> - <h2>New Document</h2> - Field with <strong><big>*</big></strong> are mandatory. + <h2>{{ 'document.create.title' | translate }}</h2> + <span translate="common.message.mandatoryFieldsInfo"></span> </div> <form class="form-horizontal" name="documentForm" role="form" @@ -38,7 +38,7 @@ <div class="" ng-class="{'has-error' : documentForm.name.$invalid && !documentForm.name.$pristine}"> - <label class="col-md-2 control-label">Name *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.name' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="name" @@ -46,20 +46,20 @@ ng-model="document.name" required /> <p ng-show="documentForm.name.$invalid && !documentForm.name.$pristine" - class="help-block">Document name is required.</p> + class="help-block">{{ 'document.message.requiredName' | translate }}</p> </div> </div> <div class="" ng-class="{'has-error' : documentForm.type.$invalid && !documentForm.type.$pristine}"> - <label class="col-md-2 control-label">Type *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.type' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="type" data-ng-model="document.type" list="modalExistingTypes" required/> <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" - class="help-block">Document type is required.</p> + class="help-block">{{ 'document.message.requiredType' | translate }}</p> </div> <datalist id="modalExistingTypes"> <option data-ng-repeat="type in modalExisting.types" value="{{type}}"> @@ -74,7 +74,7 @@ documentForm.externalUrl.$invalid && !documentForm.externalUrl.$pristine && !upload.file}"> <div class=""> - <label class="col-md-2 control-label">File</label> + <label class="col-md-2 control-label">{{ 'document.metadata.file' | translate }}</label> <div class="col-md-4"> <input type="file" class="form-control" name="uploadFile" @@ -83,7 +83,7 @@ </div> <div class=""> - <label class="col-md-2 control-label">External URL</label> + <label class="col-md-2 control-label">{{ 'document.metadata.externalUrl' | translate }}</label> <div class="col-md-4"> <input type="input" class="form-control" name="externalUrl" @@ -93,8 +93,7 @@ </div> </div> <p ng-show="!document.externalUrl && !file.upload" - class="help-block text-center">A File or an external URL is - required.</p> + class="help-block text-center">{{ 'document.message.requiredExternalUrlOrFile' | translate }}</p> </div> <!-- End Line with file and externalURL --> @@ -104,7 +103,7 @@ <div ng-class="{'has-error' : documentForm.keywords.$invalid && !documentForm.keywords.$pristine}"> - <label class="col-md-2 control-label">keywords *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.keywords' | translate }} *</label> <div class="col-md-2"> <input type="text" class="form-control" name="keywords" @@ -112,7 +111,7 @@ data-ng-model="modalToAddKeyword" list="modalExistingKeywords"/> <p ng-show="document.keywords.length < 1 && !documentForm.keywords.$pristine" - class="help-block">At least one keyword is required.</p> + class="help-block">{{ 'document.message.requiredKeywords' | translate }}</p> </div> <datalist id="modalExistingKeywords"> <option data-ng-repeat="keyword in modalExisting.keywords" value="{{keyword}}"> @@ -121,7 +120,7 @@ <div class="col-md-1"> <button class="btn btn-primary" value="add" - ng-click="addKeyword(modalToAddKeyword); modalToAddKeyword=''">add</button> + ng-click="addKeyword(modalToAddKeyword); modalToAddKeyword=''">{{ 'common.button.add' | translate }}</button> </div> @@ -140,7 +139,7 @@ <!-- Line with Publication Date and privacy --> <div class="form-group"> <div class=""> - <label class="col-md-2 control-label">Publication date</label> + <label class="col-md-2 control-label">{{ 'document.metadata.publicationDate' | translate }}</label> <div class="col-md-4"> <div class="input-group"> @@ -157,14 +156,14 @@ </div> <div class=""> - <label class="col-md-2 control-label">Privacy</label> + <label class="col-md-2 control-label">{{ 'document.metadata.privacy' | translate }}</label> <div class="col-md-4"> <select class="form-control" name="privacy" ng-model="document.privacy"> - <option value="PRIVATE">Private</option> - <option value="PUBLIC">Public</option> - <option value="RESTRICTED">Restricted to current Question</option> + <option value="PRIVATE">{{ 'common.privacy.private' | translate }}</option> + <option value="PUBLIC">{{ 'common.privacy.public' | translate }}</option> + <option value="RESTRICTED">{{ 'document.privacy.questionRestricted' | translate }}</option> </select> </div> @@ -178,7 +177,7 @@ <div class="" ng-class="{'has-error' : documentForm.authors.$invalid && !documentForm.authors.$pristine}"> - <label class="col-md-2 control-label">Authors *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.authors' | translate }} *</label> <div class="col-md-5"> <input type="text" class="form-control" name="authors" @@ -186,12 +185,12 @@ ng-model="document.authors" required/> <p ng-show="documentForm.authors.$invalid && !documentForm.authors.$pristine" - class="help-block">Document authors is required.</p> + class="help-block">{{ 'document.message.requiredAuthors' | translate }}</p> </div> </div> <div class=""> - <label class="col-md-2 control-label">Language</label> + <label class="col-md-2 control-label">{{ 'document.metadata.language' | translate }}</label> <div class="col-md-3"> <input type="text" class="form-control" name="language" @@ -206,7 +205,7 @@ <div class="form-group"> <div ng-class="{'has-error' : documentForm.copyright.$invalid && !documentForm.copyright.$pristine}"> - <label class="col-md-2 control-label">Copyright *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.copyright' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="copyright" @@ -214,12 +213,12 @@ ng-model="document.copyright" required/> <p ng-show="documentForm.copyright.$invalid && !documentForm.copyright.$pristine" - class="help-block">Copyright is required.</p> + class="help-block">{{ 'document.message.requiredCopyright' | translate }}</p> </div> </div> <div class="form-group"> - <label class="col-md-2 control-label">Licence</label> + <label class="col-md-2 control-label">{{ 'document.metadata.licence' | translate }}</label> <div class="col-md-4"> <input type="text" class="form-control" name="licence" @@ -233,7 +232,7 @@ <!-- Line with Summary --> <div class="form-group" ng-class="{'has-error' : documentForm.summary.$invalid && !documentForm.summary.$pristine}"> - <label class="col-md-2 control-label">Summary *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.summary' | translate }} *</label> <div class="col-md-10"> <textarea type="text" class="form-control" name="summary" rows="5" @@ -241,14 +240,14 @@ ng-model="document.summary" required/> <p ng-show="documentForm.summary.$invalid && !documentForm.summary.$pristine" - class="help-block">A summary is required.</p> + class="help-block">{{ 'document.message.requiredSummary' | translate }}</p> </div> </div> <!-- End Line with Summary --> <!-- Line with Comment --> <div class="form-group" > - <label class="col-md-2 control-label">Comment</label> + <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> <div class="col-md-10"> <textarea type="text" class="form-control" name="comment" rows="5" @@ -262,7 +261,7 @@ <div class="modal-footer"> <input type="submit" class="btn btn-primary" /> - <button class="btn btn-warning" ng-click="cancel()">Cancel</button> + <button class="btn btn-warning" ng-click="cancel()">{{ 'common.button.cancel' | translate }}</button> </div> </form> diff --git a/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html b/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html index 1e74a48..227c9a2 100644 --- a/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html +++ b/coselmar-ui/src/main/webapp/views/documents/modalDocumentSearch.html @@ -26,7 +26,7 @@ <div class="page-header"> <h1> <!-- Heading goes here --> - Search Documents + {{ 'document.modalSearch.title' | translate }} </h1> </div> @@ -44,12 +44,13 @@ <br/> <table class="table"> <tr> - <th>Name</th> - <th>Authors</th> - <th>Privacy</th> - <th>Keywords</th> - <th>Depositor</th> - <th>Deposit Date</th> + <th>{{ 'document.metadata.name' | translate }}</th> + <th>{{ 'document.metadata.authors' | translate }}</th> + <th>{{ 'document.metadata.privacy' | translate }}</th> + <th>{{ 'document.metadata.keywords' | translate }}</th> + <th>{{ 'document.metadata.depositor' | translate }}</th> + <th>{{ 'document.metadata.depositDate' | translate }}</th> + <th>{{ 'document.metadata.relatedQuestions' | translate }}</th> <th></th> </tr> <tr ng-repeat="document in documents"> @@ -65,6 +66,6 @@ </table> </div> <div class="modal-footer"> - <button class="btn btn-warning" ng-click="cancel()">Cancel</button> + <button class="btn btn-warning" ng-click="cancel()">{{ 'common.button.cancel' | translate }}</button> </div> </div> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/documents/newdocument.html b/coselmar-ui/src/main/webapp/views/documents/newdocument.html index d8e2306..05cc70b 100644 --- a/coselmar-ui/src/main/webapp/views/documents/newdocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/newdocument.html @@ -23,20 +23,13 @@ --> <div style="padding: 0px 0px 0px 30px"> <div class="page-header" style="margin: 0"> - <h2>New Document</h2> + <h2>{{ 'document.create.title' | translate }}</h2> + <span translate="common.message.mandatoryFieldsInfo"></span> </div> <div class="info-panel"> <!-- Summary goes here --> - Here you can add a new document in the repository. For each document, - some keywords are needed to make easier search of the document, and you - can specify a privacy : - <ul> - <li>Public : all members can see the document</li> - <li>Private : only you can see the document</li> - <li>Restricted : you can specify who can see the document specifically - </li> - </ul> + <p translate="document.create.info"></p> </div> <div style="padding-bottom: 50px"> @@ -49,7 +42,7 @@ <div class="form-group row"> <div class="" ng-class="{'has-error' : documentForm.name.$invalid && !documentForm.name.$pristine}"> - <label class="col-md-2 control-label">Name *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.name' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="name" @@ -57,20 +50,20 @@ ng-model="document.name" required/> <p ng-show="documentForm.name.$invalid && !documentForm.name.$pristine" - class="help-block">Document name is required.</p> + class="help-block">{{ 'document.message.requiredName' | translate }}</p> </div> </div> <div class="" ng-class="{'has-error' : documentForm.type.$invalid && !documentForm.type.$pristine}"> - <label class="col-md-1 control-label">Type *</label> + <label class="col-md-1 control-label">{{ 'document.metadata.type' | translate }} *</label> <div class="col-md-2"> <input type="text" class="form-control" name="type" data-ng-model="document.type" list="existingTypes" required/> <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" - class="help-block">Document type is required.</p> + class="help-block">{{ 'document.message.requiredType' | translate }}</p> </div> <datalist id="existingTypes"> <option data-ng-repeat="type in existing.types" value="{{type}}"> @@ -79,18 +72,18 @@ <div> - <label class="col-md-1 control-label">Privacy</label> + <label class="col-md-1 control-label">{{ 'document.metadata.privacy' | translate }}</label> <div class="col-md-2"> <select class="form-control" name="privacy" ng-model="document.privacy"> - <option value="PRIVATE">private</option> - <option value="PUBLIC">public</option> - <option value="RESTRICTED">restricted</option> + <option value="PRIVATE">{{ 'common.privacy.private' | translate }}</option> + <option value="PUBLIC">{{ 'common.privacy.public' | translate }}</option> + <option value="RESTRICTED">{{ 'common.privacy.restricted' | translate }}</option> </select> <div ng-if="document.privacy == 'RESTRICTED'"> - Not Yet available + {{ 'common.message.notYetAvailable' | translate }} </div> </div> </div> @@ -102,7 +95,7 @@ && !documentForm.externalUrl.$pristine && !upload.file}"> <div> - <label class="col-md-2 control-label">File</label> + <label class="col-md-2 control-label">{{ 'document.metadata.file' | translate }}</label> <div class="col-md-4"> <input type="file" class="form-control" name="uploadFile" @@ -111,7 +104,7 @@ </div> <div> - <label class="col-md-2 control-label">External URL</label> + <label class="col-md-2 control-label">{{ 'document.metadata.externalUrl' | translate }}</label> <div class="col-md-4"> <input type="input" class="form-control" name="externalUrl" @@ -121,8 +114,7 @@ </div> </div> <p ng-show="!document.externalUrl && !file.upload" - class="help-block text-center clear">At least a File or an external URL is - required.</p> + class="help-block text-center clear">{{ 'document.message.requiredExternalUrlOrFile' | translate }}</p> </div> <!-- Line with Keywords --> @@ -130,7 +122,7 @@ <div ng-class="{'has-error' : documentForm.keywords.$invalid && !documentForm.keywords.$pristine}"> - <label class="col-md-2 control-label">keywords *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.keywords' | translate }} *</label> <div class="col-md-2"> <input type="text" class="form-control" name="keywords" @@ -138,7 +130,7 @@ ng-model="toAddKeyword" list="existingKeywords" /> <p ng-show="document.keywords.length < 1 && !documentForm.keywords.$pristine" - class="help-block">At least one keyword is required.</p> + class="help-block">{{ 'document.message.requiredKeywords' | translate }}</p> </div> <datalist id="existingKeywords"> <option data-ng-repeat="keyword in existing.keywords" value="{{keyword}}"> @@ -147,7 +139,7 @@ <div class="col-md-1"> <button class="btn btn-primary" value="add" - ng-click="addKeyword(toAddKeyword); toAddKeyword=''">add</button> + ng-click="addKeyword(toAddKeyword); toAddKeyword=''">{{ 'common.button.add' | translate }}</button> </div> @@ -166,7 +158,7 @@ <div class="form-group"> <div ng-class="{'has-error' : documentForm.authors.$invalid && !documentForm.authors.$pristine}"> - <label class="col-md-2 control-label">Authors *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.authors' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="authors" @@ -174,14 +166,14 @@ ng-model="document.authors" required/> <p ng-show="documentForm.authors.$invalid && !documentForm.authors.$pristine" - class="help-block">Document authors is required.</p> + class="help-block">{{ 'document.message.requiredAuthors' | translate }}</p> </div> </div> <div ng-class="{'has-error' : documentForm.copyright.$invalid && !documentForm.copyright.$pristine}"> - <label class="col-md-2 control-label">Copyright *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.copyright' | translate }} *</label> <div class="col-md-4"> <input type="text" class="form-control" name="copyright" @@ -189,7 +181,7 @@ ng-model="document.copyright" required/> <p ng-show="documentForm.copyright.$invalid && !documentForm.copyright.$pristine" - class="help-block">Copyright is required.</p> + class="help-block">{{ 'document.message.requiredCopyright' | translate }}</p> </div> </div> </div> @@ -197,7 +189,7 @@ <!-- Line with License, publication date and language --> <div class="form-group"> <div > - <label class="col-md-2 control-label">Licence</label> + <label class="col-md-2 control-label">{{ 'document.metadata.licence' | translate }}</label> <div class="col-md-4"> <input type="text" class="form-control" name="licence" @@ -207,7 +199,7 @@ </div> <div> - <label class="col-md-1 control-label">Language</label> + <label class="col-md-1 control-label">{{ 'document.metadata.language' | translate }}</label> <div class="col-md-1"> <input type="text" class="form-control" name="language" @@ -217,7 +209,7 @@ </div> <div> - <label class="col-md-2 control-label">Publication date</label> + <label class="col-md-2 control-label">{{ 'document.metadata.publicationDate' | translate }}</label> <div class="col-md-2"> <div class="input-group"> @@ -236,7 +228,7 @@ <!-- Summary --> <div class="form-group" ng-class="{'has-error' : documentForm.summary.$invalid && !documentForm.summary.$pristine}"> - <label class="col-md-2 control-label">Summary *</label> + <label class="col-md-2 control-label">{{ 'document.metadata.summary' | translate }} *</label> <div class="col-md-10"> <textarea type="text" class="form-control" name="summary" rows="5" @@ -244,13 +236,13 @@ ng-model="document.summary" required/> <p ng-show="documentForm.summary.$invalid && !documentForm.summary.$pristine" - class="help-block">A summary is required.</p> + class="help-block">{{ 'document.message.requiredSummary' | translate }}</p> </div> </div> <!-- Comment --> <div class="form-group" > - <label class="col-md-2 control-label">Comment</label> + <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> <div class="col-md-10"> <textarea type="text" class="form-control" name="comment" rows="5" diff --git a/coselmar-ui/src/main/webapp/views/documents/viewDocument.html b/coselmar-ui/src/main/webapp/views/documents/viewDocument.html index 34313b4..3a92f53 100644 --- a/coselmar-ui/src/main/webapp/views/documents/viewDocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/viewDocument.html @@ -8,79 +8,79 @@ <div> <table class="table table-striped"> <tr> - <td>File Name</td> + <td>{{ 'document.metadata.name' | translate }}</td> <td>{{document.name}}</td> </tr> <tr> - <td>Depositor</td> + <td>{{ 'document.metadata.depositor' | translate }}</td> <td>{{document.ownerName}}</td> </tr> <tr> - <td>Type</td> + <td>{{ 'document.metadata.type' | translate }}</td> <td>{{document.type}}</td> </tr> <tr> - <td>Keywords</td> + <td>{{ 'document.metadata.keywords' | translate }}</td> <td>{{document.keywords}}</td> </tr> <tr> - <td>Privacy</td> + <td>{{ 'document.metadata.privacy' | translate }}</td> <td>{{document.privacy}}</td> </tr> <tr> - <td>Deposite Date</td> + <td>{{ 'document.metadata.depositDate' | translate }}</td> <td>{{document.depositDate | date:'mediumDate'}}</td> </tr> <tr> - <td>Summary</td> + <td>{{ 'document.metadata.summary' | translate }}</td> <td>{{document.summary}}</td> </tr> <tr> - <td>Authors</td> + <td>{{ 'document.metadata.authors' | translate }}</td> <td>{{document.authors}}</td> </tr> <tr> - <td>Copyright</td> + <td>{{ 'document.metadata.copyright' | translate }}</td> <td>{{document.copyright}}</td> </tr> <tr> - <td>License</td> + <td>{{ 'document.metadata.licence' | translate }}</td> <td>{{document.license}}</td> </tr> <tr> - <td>Language</td> + <td>{{ 'document.metadata.language' | translate }}</td> <td>{{document.language}}</td> </tr> <tr> - <td>PublicationDate</td> + <td>{{ 'document.metadata.publicationDate' | translate }}</td> <td>{{document.publicationDate | date:'mediumDate'}}</td> </tr> <tr> - <td>Document type</td> + <td>{{ 'document.metadata.type' | translate }}</td> <td ng-if="document.withFile">{{document.mimeType}}</td> - <td ng-if="!document.withFile">External Link</td> + <td ng-if="!document.withFile">{{ 'document.metadata.externalLink' | translate }}</td> </tr> <tr ng-if="document.withFile && document.fileName"> - <td>Document File</td> + <td>{{ 'document.metadata.fileName' | translate }}</td> <td>{{document.fileName}}</td> </tr> <tr> - <td>Comment</td> + <td>{{ 'document.metadata.comment' | translate }}</td> <td>{{document.comment}}</td> </tr> <tr> - <td>Questions with the document</td> + <td>{{ 'document.metadata.view.relatedQuestions' | translate }}</td> <td>{{document.relatedQuestions.length || 0}}</td> </tr> </table> <div class="float-right"> <a class="btn btn-action btn-edit" ng-click="edit()" ng-if="editSession != true && canEdit"> - <span class="fa fa-edit" aria-hidden="true"></span>Edit + <span class="fa fa-edit" aria-hidden="true"></span>{{ 'common.button.edit' | translate }} </a> - <a href="{{container.baseUrl}}/documents/{{document.id}}/file" class="btn btn-action btn-success" ng-if="document.withFile">Download</a> - <a href="{{document.externalUrl}}" target="_blank" class="btn btn-action btn-success" ng-if="document.externalUrl">Open Link</a> + <a href="{{container.baseUrl}}/documents/{{document.id}}/file" class="btn btn-action btn-success" ng-if="document.withFile">{{ 'document.button.download' | translate }}</a> + <a href="{{document.externalUrl}}" target="_blank" class="btn btn-action btn-success" ng-if="document.externalUrl">{{ 'document.button.openLink' | translate }}</a> <a class="btn btn-action btn-disable" ng-if="currentUser.role == 'ADMIN'" ng-confirm-message="Do you really want to delete this document ?" - ng-confirm-click="deleteDocument(document.id)">Delete</a> + ng-confirm-click="deleteDocument(document.id)">{{ 'common.button.delete' | translate }}</a> </div> </div> \ No newline at end of file diff --git a/pom.xml b/pom.xml index cca7369..6785227 100644 --- a/pom.xml +++ b/pom.xml @@ -147,6 +147,7 @@ <angularUiSelectVersion>0.9.0</angularUiSelectVersion> <angularUiBootstrapVersion>0.12.0</angularUiBootstrapVersion> + <angularTranslateVersion>2.5.2</angularTranslateVersion> </properties> @@ -389,6 +390,13 @@ <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>angular-translate</artifactId> + <version>${angularTranslateVersion}</version> + <scope>runtime</scope> + </dependency> + <!-- Others --> <dependency> <groupId>com.github.spullara.mustache.java</groupId> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.