Fix localization.

This commit is contained in:
Alexander Weidinger 2016-03-17 13:42:06 +01:00 committed by Hendrik Leppelsack
parent 54a7de52c1
commit aa94057e33
3 changed files with 24 additions and 10 deletions

View File

@ -2,15 +2,17 @@ app.controller('contactlistCtrl', function($scope, $filter, $route, $routeParams
var ctrl = this;
ctrl.routeParams = $routeParams;
ctrl.t = {
addContact : t('contacts', 'Add contact'),
emptySearch : t('contacts', 'No search result for')
};
ctrl.contactList = [];
ctrl.selectedContactId = undefined;
ctrl.searchTerm = '';
ctrl.t = {
addContact : t('contacts', 'Add contact'),
emptySearch : t('contacts', 'No search result for {query}', {query: ctrl.searchTerm})
};
$scope.query = function(contact) {
return contact.matches(SearchService.getSearchTerm());
};
@ -26,6 +28,11 @@ app.controller('contactlistCtrl', function($scope, $filter, $route, $routeParams
}
if (ev.event === 'changeSearch') {
ctrl.searchTerm = ev.searchTerm;
ctrl.t.emptySearch;
ctrl.t.emptySearch = t('contacts',
'No search result for {query}',
{query: ctrl.searchTerm}
);
$scope.$apply();
}
});

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,6 @@
<div ng-show="!ctrl.contactList.length">
<div id="emptysearch" class="">
<div class="icon-search"></div>
<h2>{{ctrl.t.emptySearch}} {{ctrl.searchTerm}}</h2>
<h2>{{ctrl.t.emptySearch}}</h2>
</div>
</div>