Mark missing translation strings in table headers.

This commit is contained in:
Emanuel Schütze 2016-12-06 23:02:25 +01:00
parent 77fdfd558f
commit f6d01c1d17
11 changed files with 109 additions and 102 deletions

View File

@ -159,20 +159,20 @@
<span class="pointer" id="dropdown{{ name }}" uib-dropdown-toggle <span class="pointer" id="dropdown{{ name }}" uib-dropdown-toggle
ng-class="{'bold': booleanFilter.value !== undefined, 'disabled': isSelectMode}" ng-class="{'bold': booleanFilter.value !== undefined, 'disabled': isSelectMode}"
ng-disabled="isSelectMode"> ng-disabled="isSelectMode">
{{ booleanFilter.displayName }} {{ booleanFilter.displayName | translate }}
<span class="caret"></span> <span class="caret"></span>
</span> </span>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown{{ name }}"> <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown{{ name }}">
<li> <li>
<a href ng-click="booleanFilter.value = (booleanFilter.value ? undefined : true); filter.save();"> <a href ng-click="booleanFilter.value = (booleanFilter.value ? undefined : true); filter.save();">
<i class="fa" ng-class="{'fa-check': booleanFilter.value === true}"></i> <i class="fa" ng-class="{'fa-check': booleanFilter.value === true}"></i>
{{ booleanFilter.choiceYes }} {{ booleanFilter.choiceYes | translate }}
</a> </a>
</li> </li>
<li> <li>
<a href ng-click="booleanFilter.value = (booleanFilter.value === false) ? undefined : false; filter.save();"> <a href ng-click="booleanFilter.value = (booleanFilter.value === false) ? undefined : false; filter.save();">
<i class="fa" ng-class="{'fa-check': booleanFilter.value === false}"></i> <i class="fa" ng-class="{'fa-check': booleanFilter.value === false}"></i>
{{ booleanFilter.choiceNo }} {{ booleanFilter.choiceNo | translate }}
</a> </a>
</li> </li>
</ul> </ul>
@ -303,15 +303,21 @@
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
<span editable-text="item.durationText" e-placeholder="hh:mm" <span editable-text="item.durationText" e-placeholder="hh:mm"
onshow="generateDurationText(item)" onaftersave="setDurationText(item)"> onshow="generateDurationText(item)" onaftersave="setDurationText(item)">
{{ (item.duration | osMinutesToTime) || ('Set duration...' | translate) }} <span ng-if="!item.duration" translate>Set duration...</span>
<span ng-if="item.duration" translate-comment="'h' means time in hours" translate>h</span> <span ng-if="item.duration">
{{ (item.duration | osMinutesToTime)}}
<translate translate-comment="'h' means time in hours">h</translate>
</span>
</span> </span>
</div> </div>
</div> </div>
<div ng-style="{'visibility': (item.comment || item.hover) ? 'visible' : 'hidden'}"> <div ng-style="{'visibility': (item.comment || item.hover) ? 'visible' : 'hidden'}">
<div class="popover-wrapper"> <div class="popover-wrapper">
<i class="fa fa-info-circle"></i> <i class="fa fa-info-circle"></i>
<span editable-text="item.comment" onaftersave="save(item)">{{ item.comment || ('Set comment...' | translate)}}</span> <span editable-text="item.comment" onaftersave="save(item)">
<span ng-if="!item.comment" translate>Set comment...</span>
<span ng-if="item.comment">{{ item.comment}}</span>
</span>
</div> </div>
</div> </div>
</small> </small>

View File

@ -446,7 +446,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf'])
var createInstance = function(allAssignmnets) { var createInstance = function(allAssignmnets) {
var title = PDFLayout.createTitle( var title = PDFLayout.createTitle(
gettextCatalog.getString(Config.get('assignments_pdf_title').value) Config.translate(Config.get('assignments_pdf_title').value)
); );
var createPreamble = function() { var createPreamble = function() {

View File

@ -356,13 +356,13 @@ angular.module('OpenSlidesApp.assignments.site', [
$scope.sort.column = 'title'; $scope.sort.column = 'title';
$scope.sortOptions = [ $scope.sortOptions = [
{name: 'agenda_item.getItemNumberWithAncestors()', {name: 'agenda_item.getItemNumberWithAncestors()',
display_name: 'Item'}, display_name: gettext('Item')},
{name: 'title', {name: 'title',
display_name: 'Title'}, display_name: gettext('Title')},
{name: 'open_posts',
display_name: 'Open posts'},
{name: 'phase', {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) { $scope.hasTag = function (assignment, tag) {
return _.indexOf(assignment.tags_id, tag.id) > -1; return _.indexOf(assignment.tags_id, tag.id) > -1;

View File

@ -455,8 +455,9 @@ angular.module('OpenSlidesApp.core', [
.factory('Config', [ .factory('Config', [
'$http', '$http',
'gettextCatalog',
'DS', 'DS',
function($http, DS) { function($http, gettextCatalog, DS) {
var configOptions; var configOptions;
return DS.defineResource({ return DS.defineResource({
name: 'core/config', name: 'core/config',
@ -468,6 +469,9 @@ angular.module('OpenSlidesApp.core', [
} }
return this.configOptions; return this.configOptions;
}, },
translate: function (value) {
return gettextCatalog.getString(value);
}
}); });
} }
]) ])

View File

@ -170,8 +170,8 @@ angular.module('OpenSlidesApp.core.pdf', [])
});*/ });*/
var line1 = [ var line1 = [
Config.get('general_event_name').value, Config.translate(Config.get('general_event_name').value),
Config.get('general_event_description').value Config.translate(Config.get('general_event_description').value)
].filter(Boolean).join(' '); ].filter(Boolean).join(' ');
var line2 = [ var line2 = [
Config.get('general_event_location').value, Config.get('general_event_location').value,
@ -312,10 +312,8 @@ angular.module('OpenSlidesApp.core.pdf', [])
]) ])
.factory('PdfMakeBallotPaperProvider', [ .factory('PdfMakeBallotPaperProvider', [
'gettextCatalog',
'Config',
'PDFLayout', 'PDFLayout',
function(gettextCatalog, Config, PDFLayout) { function(PDFLayout) {
/** /**
* Provides the global Document * Provides the global Document
* @constructor * @constructor

View File

@ -168,6 +168,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
} }
// summary of change recommendations (for motion diff version only) // summary of change recommendations (for motion diff version only)
if ($scope.viewChangeRecommendations) {
if ($scope.viewChangeRecommendations.mode == "diff") { if ($scope.viewChangeRecommendations.mode == "diff") {
var columnLineNumbers = []; var columnLineNumbers = [];
var columnChangeType = []; var columnChangeType = [];
@ -212,6 +213,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
} }
]); ]);
} }
}
// build table // build table
var metaTableJsonString = { var metaTableJsonString = {
@ -398,7 +400,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
var createInstance = function(allMotions, $scope) { var createInstance = function(allMotions, $scope) {
var title = PDFLayout.createTitle( var title = PDFLayout.createTitle(
gettextCatalog.getString(Config.get('motions_export_title').value) Config.translate(Config.get('motions_export_title').value)
); );
var createPreamble = function() { var createPreamble = function() {

View File

@ -790,6 +790,8 @@ angular.module('OpenSlidesApp.motions.site', [
'$scope', '$scope',
'$state', '$state',
'$http', '$http',
'gettext',
'gettextCatalog',
'ngDialog', 'ngDialog',
'MotionForm', 'MotionForm',
'Motion', 'Motion',
@ -799,21 +801,21 @@ angular.module('OpenSlidesApp.motions.site', [
'User', 'User',
'Agenda', 'Agenda',
'MotionBlock', 'MotionBlock',
'MotionCsvExport',
'MotionDocxExport', 'MotionDocxExport',
'MotionContentProvider', 'MotionContentProvider',
'MotionCatalogContentProvider', 'MotionCatalogContentProvider',
'PdfMakeConverter', 'PdfMakeConverter',
'PdfMakeDocumentProvider', 'PdfMakeDocumentProvider',
'gettextCatalog',
'HTMLValidizer', 'HTMLValidizer',
'Projector', 'Projector',
'ProjectionDefault', 'ProjectionDefault',
'MotionCsvExport',
'osTableFilter', 'osTableFilter',
'osTableSort', 'osTableSort',
function($scope, $state, $http, ngDialog, MotionForm, Motion, Category, Tag, Workflow, User, Agenda, MotionBlock, function($scope, $state, $http, gettext, gettextCatalog, ngDialog, MotionForm, Motion,
MotionDocxExport, MotionContentProvider, MotionCatalogContentProvider, PdfMakeConverter, PdfMakeDocumentProvider, Category, Tag, Workflow, User, Agenda, MotionBlock, MotionCsvExport, MotionDocxExport,
gettextCatalog, HTMLValidizer, Projector, ProjectionDefault, MotionCsvExport, osTableFilter, osTableSort) { MotionContentProvider, MotionCatalogContentProvider, PdfMakeConverter, PdfMakeDocumentProvider,
HTMLValidizer, Projector, ProjectionDefault, osTableFilter, osTableSort) {
Motion.bindAll({}, $scope, 'motions'); Motion.bindAll({}, $scope, 'motions');
Category.bindAll({}, $scope, 'categories'); Category.bindAll({}, $scope, 'categories');
MotionBlock.bindAll({}, $scope, 'motionBlocks'); MotionBlock.bindAll({}, $scope, 'motionBlocks');
@ -872,21 +874,21 @@ angular.module('OpenSlidesApp.motions.site', [
$scope.sort.column = 'identifier'; $scope.sort.column = 'identifier';
$scope.sortOptions = [ $scope.sortOptions = [
{name: 'identifier', {name: 'identifier',
display_name: 'Identifier'}, display_name: gettext('Identifier')},
{name: 'getTitle()', {name: 'getTitle()',
display_name: 'Title'}, display_name: gettext('Title')},
{name: 'submitters', {name: 'submitters',
display_name: 'Submitters'}, display_name: gettext('Submitters')},
{name: 'category.name', {name: 'category.name',
display_name: 'Category'}, display_name: gettext('Category')},
{name: 'motionBlock.title', {name: 'motionBlock.title',
display_name: 'Motion block'}, display_name: gettext('Motion block')},
{name: 'state.name', {name: 'state.name',
display_name: 'State'}, display_name: gettext('State')},
{name: 'log_messages[log_messages.length-1].time', {name: 'log_messages[log_messages.length-1].time',
display_name: 'Creation date'}, display_name: gettext('Creation date')},
{name: 'log_messages[0].time', {name: 'log_messages[0].time',
display_name: 'Last modified'}, display_name: gettext('Last modified')},
]; ];
// collect all states of all workflows // collect all states of all workflows
@ -1984,6 +1986,9 @@ angular.module('OpenSlidesApp.motions.site', [
// subgroup PDF // subgroup PDF
gettext('Title for PDF and DOCX documents (all motions)'); gettext('Title for PDF and DOCX documents (all motions)');
gettext('Preamble text 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');
} }
]); ]);

View File

@ -112,14 +112,6 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf'])
var createInstance = function(userList, groups, Config) { 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 creadeUserHeadLine = function(user) {
var titleLine = []; var titleLine = [];
titleLine.push({ titleLine.push({
@ -149,7 +141,7 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf'])
style: 'userDataTopic' style: 'userDataTopic'
}, },
{ {
text: getConfigValue('users_pdf_wlan_ssid'), text: Config.get('users_pdf_wlan_ssid').value || '-',
style: 'userDataValue' style: 'userDataValue'
}, },
{ {
@ -157,7 +149,7 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf'])
style: 'userDataTopic' style: 'userDataTopic'
}, },
{ {
text: getConfigValue('users_pdf_wlan_password'), text: Config.get('users_pdf_wlan_password').value || '-',
style: 'userDataValue' style: 'userDataValue'
}, },
{ {
@ -165,7 +157,7 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf'])
style: 'userDataTopic' style: 'userDataTopic'
}, },
{ {
text: getConfigValue('users_pdf_wlan_encryption'), text: Config.get('users_pdf_wlan_encryption').value || '-',
style: 'userDataValue' style: 'userDataValue'
}, },
] ]
@ -197,8 +189,8 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf'])
style: 'userDataTopic' style: 'userDataTopic'
}, },
{ {
text: getConfigValue('users_pdf_url'), text: Config.get('users_pdf_url').value || '-',
link: getConfigValue('users_pdf_url'), link: Config.get('users_pdf_url').value,
style: 'userDataValue' style: 'userDataValue'
}, },
] ]
@ -213,11 +205,11 @@ angular.module('OpenSlidesApp.users.pdf', ['OpenSlidesApp.core.pdf'])
var createWelcomeText = function() { var createWelcomeText = function() {
return [ return [
{ {
text: getConfigValue('users_pdf_welcometitle'), text: Config.translate(Config.get('users_pdf_welcometitle').value),
style: 'userDataHeading' style: 'userDataHeading'
}, },
{ {
text: getConfigValue('users_pdf_welcometext'), text: Config.translate(Config.get('users_pdf_welcometext').value),
style: 'userDataTopic' style: 'userDataTopic'
} }
]; ];

View File

@ -564,21 +564,21 @@ angular.module('OpenSlidesApp.users.site', [
$scope.sort.column = $scope.config('users_sort_by'); $scope.sort.column = $scope.config('users_sort_by');
$scope.sortOptions = [ $scope.sortOptions = [
{name: 'first_name', {name: 'first_name',
display_name: 'Given name'}, display_name: gettext('Given name')},
{name: 'last_name', {name: 'last_name',
display_name: 'Surname'}, display_name: gettext('Surname')},
{name: 'is_present', {name: 'is_present',
display_name: 'Present'}, display_name: gettext('Present')},
{name: 'is_active', {name: 'is_active',
display_name: 'Active'}, display_name: gettext('Active')},
{name: 'is_committee', {name: 'is_committee',
display_name: 'Committee'}, display_name: gettext('Committee')},
{name: 'number', {name: 'number',
display_name: 'Number'}, display_name: gettext('Number')},
{name: 'structure_level', {name: 'structure_level',
display_name: 'Structure level'}, display_name: gettext('Structure level')},
{name: 'comment', {name: 'comment',
display_name: 'Comment'}, display_name: gettext('Comment')},
]; ];
// pagination // pagination

View File

@ -28,7 +28,7 @@
<span class="optional"> <span class="optional">
{{ group.name | translate }} {{ group.name | translate }}
</span> </span>
<span class="optional-show" uib-tooltip="{{ group.name }}"> <span class="optional-show" uib-tooltip="{{ group.name | translate }}">
{{ group.name | translate | limitTo: 1 }}... {{ group.name | translate | limitTo: 1 }}...
</span> </span>
<i class="fa fa-info-circle" ng-if="group.id == 1" <i class="fa fa-info-circle" ng-if="group.id == 1"

View File

@ -176,20 +176,20 @@
<span class="pointer" id="dropdown{{ name }}" uib-dropdown-toggle <span class="pointer" id="dropdown{{ name }}" uib-dropdown-toggle
ng-class="{'bold': booleanFilter.value !== undefined, 'disabled': isSelectMode}" ng-class="{'bold': booleanFilter.value !== undefined, 'disabled': isSelectMode}"
ng-disabled="isSelectMode"> ng-disabled="isSelectMode">
{{ booleanFilter.displayName }} {{ booleanFilter.displayName | translate }}
<span class="caret"></span> <span class="caret"></span>
</span> </span>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown{{ name }}"> <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown{{ name }}">
<li> <li>
<a href ng-click="booleanFilter.value = (booleanFilter.value ? undefined : true); filter.save();"> <a href ng-click="booleanFilter.value = (booleanFilter.value ? undefined : true); filter.save();">
<i class="fa" ng-class="{'fa-check': booleanFilter.value === true}"></i> <i class="fa" ng-class="{'fa-check': booleanFilter.value === true}"></i>
{{ booleanFilter.choiceYes }} {{ booleanFilter.choiceYes | translate }}
</a> </a>
</li> </li>
<li> <li>
<a href ng-click="booleanFilter.value = (booleanFilter.value === false) ? undefined : false; filter.save();"> <a href ng-click="booleanFilter.value = (booleanFilter.value === false) ? undefined : false; filter.save();">
<i class="fa" ng-class="{'fa-check': booleanFilter.value === false}"></i> <i class="fa" ng-class="{'fa-check': booleanFilter.value === false}"></i>
{{ booleanFilter.choiceNo }} {{ booleanFilter.choiceNo | translate }}
</a> </a>
</li> </li>
</ul> </ul>