Added in locales for filter operators.

pull/1101/head
Richard 11 years ago
parent df900348a3
commit e48fa84c27
  1. 20
      app/assets/javascripts/angular/config/work-packages-config.js
  2. 6
      app/assets/javascripts/angular/controllers/work-packages-controller.js
  3. 11
      app/assets/javascripts/angular/helpers/filters-helper.js
  4. 18
      config/locales/js-de.yml
  5. 17
      config/locales/js-en.yml

@ -31,16 +31,16 @@ angular.module('openproject.workPackages.config')
.constant('INITIALLY_SELECTED_COLUMNS', ['id', 'project', 'type', 'status', 'priority', 'subject', 'assigned_to_id', 'updated_at']) .constant('INITIALLY_SELECTED_COLUMNS', ['id', 'project', 'type', 'status', 'priority', 'subject', 'assigned_to_id', 'updated_at'])
.constant('OPERATORS_AND_LABELS_BY_FILTER_TYPE', { .constant('OPERATORS_AND_LABELS_BY_FILTER_TYPE', {
list: {'=':'is','!':'is not'}, list: {'=':'label_equals','!':'label_not_equals'},
list_model: {'=':'is','!':'is not'}, list_model: {'=':'label_equals','!':'label_not_equals'},
list_status: {'o':'open','=':'is','!':'is not','c':'closed','*':'all'}, // TODO RS: Need a generalised solution list_status: {'o':'label_open_work_packages','=':'label_equals','!':'label_not_equals','c':'label_closed_work_packages','*':'label_all'},
list_optional: {'=':'is','!':'is not','!*':'none','*':'all'}, list_optional: {'=':'label_equals','!':'label_not_equals','!*':'label_none','*':'label_all'},
list_subprojects: {'*':'all','!*':'none','=':'is'}, list_subprojects: {'*':'label_all','!*':'label_none','=':'label_equals'},
date: {'<t+':'in less than','>t+':'in more than','t+':'in','t':'today','w':'this week','>t-':'less than days ago','<t-':'more than days ago','t-':'days ago'}, date: {'<t+':'label_in_less_than','>t+':'label_in_more_than','t+':'label_in','t':'label_today','w':'label_this_week','>t-':'label_less_than_ago','<t-':'label_more_than_ago','t-':'label_ago'},
date_past: {'>t-':'less than days ago','<t-':'more than days ago','t-':'days ago','t':'today','w':'this week'}, date_past: {'>t-':'label_less_than_ago','<t-':'label_more_than_ago','t-':'label_ago','t':'label_today','w':'label_this_week'},
string: {'=':'is','~':'contains','!':'is not','!~':"doesn't contain"}, string: {'=':'label_equals','~':'label_contains','!':'label_not_equals','!~':"label_not_contains"},
text: {'~':'contains','!~':"doesn't contain"}, text: {'~':'label_contains','!~':"label_not_contains"},
integer: {'=':'is','>=':'>=','<=':'<=','!*':'none','*':'all'} integer: {'=':'label_equals','>=':'label_greater_or_equal','<=':'label_less_or_equal','!*':'label_none','*':'label_all'}
}) })
.constant('AVAILABLE_WORK_PACKAGE_FILTERS', { .constant('AVAILABLE_WORK_PACKAGE_FILTERS', {

@ -28,8 +28,8 @@
angular.module('openproject.workPackages.controllers') angular.module('openproject.workPackages.controllers')
.controller('WorkPackagesController', ['$scope', '$window', 'WorkPackagesTableHelper', 'Query', 'Sortation', 'WorkPackageService', 'QueryService', 'PaginationService', 'WorkPackageLoadingHelper', 'INITIALLY_SELECTED_COLUMNS', 'OPERATORS_AND_LABELS_BY_FILTER_TYPE', .controller('WorkPackagesController', ['$scope', '$window', 'WorkPackagesTableHelper', 'FiltersHelper', 'Query', 'Sortation', 'WorkPackageService', 'QueryService', 'PaginationService', 'WorkPackageLoadingHelper', 'INITIALLY_SELECTED_COLUMNS', 'OPERATORS_AND_LABELS_BY_FILTER_TYPE',
function($scope, $window, WorkPackagesTableHelper, Query, Sortation, WorkPackageService, QueryService, PaginationService, WorkPackageLoadingHelper, INITIALLY_SELECTED_COLUMNS, OPERATORS_AND_LABELS_BY_FILTER_TYPE) { function($scope, $window, WorkPackagesTableHelper, FiltersHelper, Query, Sortation, WorkPackageService, QueryService, PaginationService, WorkPackageLoadingHelper, INITIALLY_SELECTED_COLUMNS, OPERATORS_AND_LABELS_BY_FILTER_TYPE) {
function setUrlParams(location) { function setUrlParams(location) {
@ -41,7 +41,7 @@ angular.module('openproject.workPackages.controllers')
} }
function initialSetup() { function initialSetup() {
$scope.operatorsAndLabelsByFilterType = OPERATORS_AND_LABELS_BY_FILTER_TYPE; $scope.operatorsAndLabelsByFilterType = FiltersHelper.localiseFilterOperatorsAndLabels(OPERATORS_AND_LABELS_BY_FILTER_TYPE);
$scope.loading = false; $scope.loading = false;
$scope.disableFilters = false; $scope.disableFilters = false;
initAvailableFilters($scope.projectIdentifier) initAvailableFilters($scope.projectIdentifier)

@ -28,7 +28,7 @@
angular.module('openproject.workPackages.helpers') angular.module('openproject.workPackages.helpers')
.factory('FiltersHelper', [function() { .factory('FiltersHelper', ['I18n', function(I18n) {
var FiltersHelper = { var FiltersHelper = {
assignAncestorLevels: function(projects){ assignAncestorLevels: function(projects){
@ -55,6 +55,15 @@ angular.module('openproject.workPackages.helpers')
indentation = indentation + '--'; indentation = indentation + '--';
} }
return indentation + " " + name; return indentation + " " + name;
},
localiseFilterOperatorsAndLabels: function(filterOperatorsAndLabels){
angular.forEach(filterOperatorsAndLabels, function(values, filterType){
angular.forEach(values, function(label, operator){
values[operator] = I18n.t('js.' + label);
});
});
return filterOperatorsAndLabels;
} }
}; };

@ -45,25 +45,43 @@ de:
general_text_No: "Nein" general_text_No: "Nein"
general_text_Yes: "Ja" general_text_Yes: "Ja"
label_add_columns: "Ausgewählte Spalten hinzufügen" label_add_columns: "Ausgewählte Spalten hinzufügen"
label_ago: "vor"
label_all: "alle"
label_all_work_packages: "alle Arbeitspakete" label_all_work_packages: "alle Arbeitspakete"
label_ascending: "Aufsteigend" label_ascending: "Aufsteigend"
label_closed_work_packages: "geschlossen"
label_collapse: "Zuklappen" label_collapse: "Zuklappen"
label_collapsed: "zugeklappt" label_collapsed: "zugeklappt"
label_collapse_all: "Alle zuklappen" label_collapse_all: "Alle zuklappen"
label_contains: "enthält"
label_descending: "Absteigend" label_descending: "Absteigend"
label_equals: "ist"
label_expand: "Aufklappen" label_expand: "Aufklappen"
label_expanded: "aufgeklappt" label_expanded: "aufgeklappt"
label_expand_all: "Alle aufklappen" label_expand_all: "Alle aufklappen"
label_greater_or_equal: ">="
label_in: "an"
label_in_less_than: "in weniger als"
label_in_more_than: "in mehr als"
label_less_or_equal: "<="
label_less_than_ago: "vor weniger als"
label_me: "ich" label_me: "ich"
label_menu_collapse: "ausblenden" label_menu_collapse: "ausblenden"
label_menu_expand: "einblenden" label_menu_expand: "einblenden"
label_more_than_ago: "vor mehr als"
label_no_data: "Nichts anzuzeigen" label_no_data: "Nichts anzuzeigen"
label_none: "kein"
label_not_contains: "enthält nicht"
label_not_equals: "ist nicht"
label_open_work_packages: "offen"
label_remove_columns: "Ausgewählte Spalten entfernen" label_remove_columns: "Ausgewählte Spalten entfernen"
label_sort_by: "Sortiert nach" label_sort_by: "Sortiert nach"
label_sorted_by: "sortiert nach" label_sorted_by: "sortiert nach"
label_sort_higher: "Eins höher" label_sort_higher: "Eins höher"
label_sort_lower: "Eins tiefer" label_sort_lower: "Eins tiefer"
label_sum_for: "Summe für" label_sum_for: "Summe für"
label_this_week: "aktuelle Woche"
label_today: "heute"
label_work_package: "Arbeitspaket" label_work_package: "Arbeitspaket"
select2: select2:
input_too_short: input_too_short:

@ -45,25 +45,42 @@ en:
general_text_No: "No" general_text_No: "No"
general_text_Yes: "Yes" general_text_Yes: "Yes"
label_add_columns: "Add selected columns" label_add_columns: "Add selected columns"
label_ago: "days ago"
label_all: "all"
label_all_work_packages: "all work packages" label_all_work_packages: "all work packages"
label_ascending: "Ascending" label_ascending: "Ascending"
label_descending: "Descending" label_descending: "Descending"
label_closed_work_packages: "closed"
label_collapse: "Collapse" label_collapse: "Collapse"
label_collapsed: "collapsed" label_collapsed: "collapsed"
label_collapse_all: "Collapse all" label_collapse_all: "Collapse all"
label_contains: "contains"
label_not_contains: "doesn't contain"
label_equals: "is"
label_expand: "Expand" label_expand: "Expand"
label_expanded: "expanded" label_expanded: "expanded"
label_expand_all: "Expand all" label_expand_all: "Expand all"
label_greater_or_equal: ">="
label_in: "in"
label_in_less_than: "in less than"
label_in_more_than: "in more than"
label_less_or_equal: "<="
label_less_than_ago: "less than days ago"
label_me: "me" label_me: "me"
label_menu_collapse: "collapse" label_menu_collapse: "collapse"
label_menu_expand: "expand" label_menu_expand: "expand"
label_more_than_ago: "more than days ago"
label_no_data: "No data to display" label_no_data: "No data to display"
label_none: "none"
label_not_equals: "is not"
label_open_work_packages: "open"
label_remove_columns: "Remove selected columns" label_remove_columns: "Remove selected columns"
label_sort_by: "Sort by" label_sort_by: "Sort by"
label_sorted_by: "sorted by" label_sorted_by: "sorted by"
label_sort_higher: "Move up" label_sort_higher: "Move up"
label_sort_lower: "Move down" label_sort_lower: "Move down"
label_sum_for: "Sum for" label_sum_for: "Sum for"
label_today: "today"
label_work_package: "Work package" label_work_package: "Work package"
select2: select2:
input_too_short: input_too_short:

Loading…
Cancel
Save