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

View File

@ -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() {

View File

@ -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;

View File

@ -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);
}
});
}
])

View File

@ -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

View File

@ -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() {

View File

@ -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');
}
]);

View File

@ -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'
}
];

View File

@ -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

View File

@ -28,7 +28,7 @@
<span class="optional">
{{ group.name | translate }}
</span>
<span class="optional-show" uib-tooltip="{{ group.name }}">
<span class="optional-show" uib-tooltip="{{ group.name | translate }}">
{{ group.name | translate | limitTo: 1 }}...
</span>
<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
ng-class="{'bold': booleanFilter.value !== undefined, 'disabled': isSelectMode}"
ng-disabled="isSelectMode">
{{ booleanFilter.displayName }}
{{ booleanFilter.displayName | translate }}
<span class="caret"></span>
</span>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown{{ name }}">
<li>
<a href ng-click="booleanFilter.value = (booleanFilter.value ? undefined : true); filter.save();">
<i class="fa" ng-class="{'fa-check': booleanFilter.value === true}"></i>
{{ booleanFilter.choiceYes }}
{{ booleanFilter.choiceYes | translate }}
</a>
</li>
<li>
<a href ng-click="booleanFilter.value = (booleanFilter.value === false) ? undefined : false; filter.save();">
<i class="fa" ng-class="{'fa-check': booleanFilter.value === false}"></i>
{{ booleanFilter.choiceNo }}
{{ booleanFilter.choiceNo | translate }}
</a>
</li>
</ul>