We need to use the translate promise for the window titles

This commit is contained in:
Johannes Zellner
2020-11-10 01:22:01 +01:00
parent ec00eecab3
commit e50ff5e364
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -8,9 +8,6 @@
var app = angular.module('Application', ['pascalprecht.translate', 'ngCookies', 'angular-md5', 'ui-notification']);
app.controller('LogsController', ['$scope', '$translate', 'Client', function ($scope, $translate, Client) {
var title = $translate.instant('logs.title');
if (title !== 'logs.title') window.document.title = title;
var search = decodeURIComponent(window.location.search).slice(1).split('&').map(function (item) { return item.split('='); }).reduce(function (o, k) { o[k[0]] = k[1]; return o; }, {});
$scope.initialized = false;
@@ -190,4 +187,8 @@ app.controller('LogsController', ['$scope', '$translate', 'Client', function ($s
}
init();
$translate([ 'logs.title' ]).then(function (tr) {
if (tr['logs.title'] !== 'logs.title') window.document.title = tr['logs.title'];
});
}]);