Add missing translations for apps grid

This commit is contained in:
Johannes Zellner
2020-12-15 15:48:25 +01:00
parent a33760a688
commit 632bb64b96
4 changed files with 62 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
/* global angular:false */
/* global $:false */
angular.module('Application').controller('AppsController', ['$scope', '$timeout', '$interval', '$location', 'Client', function ($scope, $timeout, $interval, $location, Client) {
angular.module('Application').controller('AppsController', ['$scope', '$translate', '$timeout', '$interval', '$location', 'Client', function ($scope, $translate, $timeout, $interval, $location, Client) {
var ALL_DOMAINS_DOMAIN = { _alldomains: true, domain: 'All Domains' }; // dummy record for the single select filter
$scope.installedApps = Client.getInstalledApps();
@@ -23,6 +23,14 @@ angular.module('Application').controller('AppsController', ['$scope', '$timeout'
$scope.domains = [];
$scope.appSearch = '';
$translate(['apps.stateFilterHeader', 'apps.domainsFilterHeader', 'app.states.running', 'app.states.stopped', 'app.states.notResponding']).then(function (tr) {
if (tr['apps.domainsFilterHeader']) ALL_DOMAINS_DOMAIN.domain = tr['apps.domainsFilterHeader'];
if (tr['apps.stateFilterHeader']) $scope.states[0].label = tr['apps.stateFilterHeader'];
if (tr['app.states.running']) $scope.states[1].label = tr['app.states.running'];
if (tr['app.states.stopped']) $scope.states[2].label = tr['app.states.stopped'];
if (tr['app.states.notResponding']) $scope.states[3].label = tr['app.states.notResponding'];
});
$scope.$watch('selectedTags', function (newVal, oldVal) {
if (newVal === oldVal) return;