diff --git a/openslides/agenda/static/templates/agenda/item-list.html b/openslides/agenda/static/templates/agenda/item-list.html index fd6dec768..a76cc772c 100644 --- a/openslides/agenda/static/templates/agenda/item-list.html +++ b/openslides/agenda/static/templates/agenda/item-list.html @@ -159,20 +159,20 @@ - {{ booleanFilter.displayName }} + {{ booleanFilter.displayName | translate }} @@ -303,15 +303,21 @@ - {{ (item.duration | osMinutesToTime) || ('Set duration...' | translate) }} - h + Set duration... + + {{ (item.duration | osMinutesToTime)}} + h +
- {{ item.comment || ('Set comment...' | translate)}} + + Set comment... + {{ item.comment}} +
diff --git a/openslides/assignments/static/js/assignments/pdf.js b/openslides/assignments/static/js/assignments/pdf.js index 4c7e9d947..8253da308 100644 --- a/openslides/assignments/static/js/assignments/pdf.js +++ b/openslides/assignments/static/js/assignments/pdf.js @@ -446,7 +446,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) var createInstance = function(allAssignmnets) { var title = PDFLayout.createTitle( - gettextCatalog.getString(Config.get('assignments_pdf_title').value) + Config.translate(Config.get('assignments_pdf_title').value) ); var createPreamble = function() { diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index 67b84f3d6..520b966ad 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -356,13 +356,13 @@ angular.module('OpenSlidesApp.assignments.site', [ $scope.sort.column = 'title'; $scope.sortOptions = [ {name: 'agenda_item.getItemNumberWithAncestors()', - display_name: 'Item'}, + display_name: gettext('Item')}, {name: 'title', - display_name: 'Title'}, - {name: 'open_posts', - display_name: 'Open posts'}, + display_name: gettext('Title')}, {name: 'phase', - display_name: 'Phase'}, + display_name: gettext('Phase')}, + {name: 'assignment.assignment_related_users.length', + display_name: gettext('Number of candidates')}, ]; $scope.hasTag = function (assignment, tag) { return _.indexOf(assignment.tags_id, tag.id) > -1; diff --git a/openslides/core/static/js/core/base.js b/openslides/core/static/js/core/base.js index ce398ab90..afb33d192 100644 --- a/openslides/core/static/js/core/base.js +++ b/openslides/core/static/js/core/base.js @@ -455,8 +455,9 @@ angular.module('OpenSlidesApp.core', [ .factory('Config', [ '$http', + 'gettextCatalog', 'DS', - function($http, DS) { + function($http, gettextCatalog, DS) { var configOptions; return DS.defineResource({ name: 'core/config', @@ -468,6 +469,9 @@ angular.module('OpenSlidesApp.core', [ } return this.configOptions; }, + translate: function (value) { + return gettextCatalog.getString(value); + } }); } ]) diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index 563bf9299..cd098bb11 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -170,8 +170,8 @@ angular.module('OpenSlidesApp.core.pdf', []) });*/ var line1 = [ - Config.get('general_event_name').value, - Config.get('general_event_description').value + Config.translate(Config.get('general_event_name').value), + Config.translate(Config.get('general_event_description').value) ].filter(Boolean).join(' – '); var line2 = [ Config.get('general_event_location').value, @@ -312,10 +312,8 @@ angular.module('OpenSlidesApp.core.pdf', []) ]) .factory('PdfMakeBallotPaperProvider', [ - 'gettextCatalog', - 'Config', 'PDFLayout', - function(gettextCatalog, Config, PDFLayout) { + function(PDFLayout) { /** * Provides the global Document * @constructor diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index deca7e3e9..12bc7e41e 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -168,49 +168,51 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) } // summary of change recommendations (for motion diff version only) - if ($scope.viewChangeRecommendations.mode == "diff") { - var columnLineNumbers = []; - var columnChangeType = []; - angular.forEach($scope.change_recommendations, function(change) { - // line numbers column - var line; - if (change.line_from >= change.line_to - 1) { - line = change.line_from; - } else { - line = change.line_from + ' - ' + (change.line_to - 1); - } - columnLineNumbers.push( - gettextCatalog.getString('Line') + ' ' + line + ': ' - ); - // change type column - if (change.getType(motion.getVersion($scope.version).text) === 0) { - columnChangeType.push(gettextCatalog.getString("Replacement")); - } else if (change.getType(motion.getVersion($scope.version).text) === 1) { - columnChangeType.push(gettextCatalog.getString("Insertion")); - } else if (change.getType(motion.getVersion($scope.version).text) === 2) { - columnChangeType.push(gettextCatalog.getString("Deletion")); - } - }); - metaTableBody.push([ - { - text: gettextCatalog.getString('Summary of change recommendations'), - style: ['bold', 'grey'] - }, - { - columns: [ - { - text: columnLineNumbers.join('\n'), - width: 'auto' - }, - { - text: columnChangeType.join('\n'), - width: 'auto' - } - ], - columnGap: 7, - style: 'grey' - } - ]); + if ($scope.viewChangeRecommendations) { + if ($scope.viewChangeRecommendations.mode == "diff") { + var columnLineNumbers = []; + var columnChangeType = []; + angular.forEach($scope.change_recommendations, function(change) { + // line numbers column + var line; + if (change.line_from >= change.line_to - 1) { + line = change.line_from; + } else { + line = change.line_from + ' - ' + (change.line_to - 1); + } + columnLineNumbers.push( + gettextCatalog.getString('Line') + ' ' + line + ': ' + ); + // change type column + if (change.getType(motion.getVersion($scope.version).text) === 0) { + columnChangeType.push(gettextCatalog.getString("Replacement")); + } else if (change.getType(motion.getVersion($scope.version).text) === 1) { + columnChangeType.push(gettextCatalog.getString("Insertion")); + } else if (change.getType(motion.getVersion($scope.version).text) === 2) { + columnChangeType.push(gettextCatalog.getString("Deletion")); + } + }); + metaTableBody.push([ + { + text: gettextCatalog.getString('Summary of change recommendations'), + style: ['bold', 'grey'] + }, + { + columns: [ + { + text: columnLineNumbers.join('\n'), + width: 'auto' + }, + { + text: columnChangeType.join('\n'), + width: 'auto' + } + ], + columnGap: 7, + style: 'grey' + } + ]); + } } // build table @@ -398,7 +400,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) var createInstance = function(allMotions, $scope) { var title = PDFLayout.createTitle( - gettextCatalog.getString(Config.get('motions_export_title').value) + Config.translate(Config.get('motions_export_title').value) ); var createPreamble = function() { diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index ec21c8152..6120d3d17 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -790,6 +790,8 @@ angular.module('OpenSlidesApp.motions.site', [ '$scope', '$state', '$http', + 'gettext', + 'gettextCatalog', 'ngDialog', 'MotionForm', 'Motion', @@ -799,21 +801,21 @@ angular.module('OpenSlidesApp.motions.site', [ 'User', 'Agenda', 'MotionBlock', + 'MotionCsvExport', 'MotionDocxExport', 'MotionContentProvider', 'MotionCatalogContentProvider', 'PdfMakeConverter', 'PdfMakeDocumentProvider', - 'gettextCatalog', 'HTMLValidizer', 'Projector', 'ProjectionDefault', - 'MotionCsvExport', 'osTableFilter', 'osTableSort', - function($scope, $state, $http, ngDialog, MotionForm, Motion, Category, Tag, Workflow, User, Agenda, MotionBlock, - MotionDocxExport, MotionContentProvider, MotionCatalogContentProvider, PdfMakeConverter, PdfMakeDocumentProvider, - gettextCatalog, HTMLValidizer, Projector, ProjectionDefault, MotionCsvExport, osTableFilter, osTableSort) { + function($scope, $state, $http, gettext, gettextCatalog, ngDialog, MotionForm, Motion, + Category, Tag, Workflow, User, Agenda, MotionBlock, MotionCsvExport, MotionDocxExport, + MotionContentProvider, MotionCatalogContentProvider, PdfMakeConverter, PdfMakeDocumentProvider, + HTMLValidizer, Projector, ProjectionDefault, osTableFilter, osTableSort) { Motion.bindAll({}, $scope, 'motions'); Category.bindAll({}, $scope, 'categories'); MotionBlock.bindAll({}, $scope, 'motionBlocks'); @@ -872,21 +874,21 @@ angular.module('OpenSlidesApp.motions.site', [ $scope.sort.column = 'identifier'; $scope.sortOptions = [ {name: 'identifier', - display_name: 'Identifier'}, + display_name: gettext('Identifier')}, {name: 'getTitle()', - display_name: 'Title'}, + display_name: gettext('Title')}, {name: 'submitters', - display_name: 'Submitters'}, + display_name: gettext('Submitters')}, {name: 'category.name', - display_name: 'Category'}, + display_name: gettext('Category')}, {name: 'motionBlock.title', - display_name: 'Motion block'}, + display_name: gettext('Motion block')}, {name: 'state.name', - display_name: 'State'}, + display_name: gettext('State')}, {name: 'log_messages[log_messages.length-1].time', - display_name: 'Creation date'}, + display_name: gettext('Creation date')}, {name: 'log_messages[0].time', - display_name: 'Last modified'}, + display_name: gettext('Last modified')}, ]; // collect all states of all workflows @@ -1984,6 +1986,9 @@ angular.module('OpenSlidesApp.motions.site', [ // subgroup PDF gettext('Title for PDF and DOCX documents (all motions)'); gettext('Preamble text for PDF and DOCX documents (all motions)'); + + // misc strings (used dynamically in templates by translate filter) + gettext('needed'); } ]); diff --git a/openslides/users/static/js/users/pdf.js b/openslides/users/static/js/users/pdf.js index 66f41e24a..9877c0e0a 100644 --- a/openslides/users/static/js/users/pdf.js +++ b/openslides/users/static/js/users/pdf.js @@ -112,14 +112,6 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf']) var createInstance = function(userList, groups, Config) { - var getConfigValue = function(val) { - if (Config.get(val).value) { - return Config.get(val).value; - } else { - return "-"; - } - }; - var creadeUserHeadLine = function(user) { var titleLine = []; titleLine.push({ @@ -149,7 +141,7 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf']) style: 'userDataTopic' }, { - text: getConfigValue('users_pdf_wlan_ssid'), + text: Config.get('users_pdf_wlan_ssid').value || '-', style: 'userDataValue' }, { @@ -157,7 +149,7 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf']) style: 'userDataTopic' }, { - text: getConfigValue('users_pdf_wlan_password'), + text: Config.get('users_pdf_wlan_password').value || '-', style: 'userDataValue' }, { @@ -165,7 +157,7 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf']) style: 'userDataTopic' }, { - text: getConfigValue('users_pdf_wlan_encryption'), + text: Config.get('users_pdf_wlan_encryption').value || '-', style: 'userDataValue' }, ] @@ -197,8 +189,8 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf']) style: 'userDataTopic' }, { - text: getConfigValue('users_pdf_url'), - link: getConfigValue('users_pdf_url'), + text: Config.get('users_pdf_url').value || '-', + link: Config.get('users_pdf_url').value, style: 'userDataValue' }, ] @@ -213,11 +205,11 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf']) var createWelcomeText = function() { return [ { - text: getConfigValue('users_pdf_welcometitle'), + text: Config.translate(Config.get('users_pdf_welcometitle').value), style: 'userDataHeading' }, { - text: getConfigValue('users_pdf_welcometext'), + text: Config.translate(Config.get('users_pdf_welcometext').value), style: 'userDataTopic' } ]; diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index 1369ce08a..c6f9930fe 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -564,21 +564,21 @@ angular.module('OpenSlidesApp.users.site', [ $scope.sort.column = $scope.config('users_sort_by'); $scope.sortOptions = [ {name: 'first_name', - display_name: 'Given name'}, + display_name: gettext('Given name')}, {name: 'last_name', - display_name: 'Surname'}, + display_name: gettext('Surname')}, {name: 'is_present', - display_name: 'Present'}, + display_name: gettext('Present')}, {name: 'is_active', - display_name: 'Active'}, + display_name: gettext('Active')}, {name: 'is_committee', - display_name: 'Committee'}, + display_name: gettext('Committee')}, {name: 'number', - display_name: 'Number'}, + display_name: gettext('Number')}, {name: 'structure_level', - display_name: 'Structure level'}, + display_name: gettext('Structure level')}, {name: 'comment', - display_name: 'Comment'}, + display_name: gettext('Comment')}, ]; // pagination diff --git a/openslides/users/static/templates/users/group-list.html b/openslides/users/static/templates/users/group-list.html index 404dcd029..951d1e8a6 100644 --- a/openslides/users/static/templates/users/group-list.html +++ b/openslides/users/static/templates/users/group-list.html @@ -28,7 +28,7 @@ {{ group.name | translate }} - + {{ group.name | translate | limitTo: 1 }}... - {{ booleanFilter.displayName }} + {{ booleanFilter.displayName | translate }}