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
@@ -6,9 +6,6 @@
angular.module('Application', ['pascalprecht.translate', 'ngCookies', 'angular-md5', 'ui-notification']);
angular.module('Application').controller('TerminalController', ['$scope', '$translate', '$timeout', '$location', 'Client', function ($scope, $translate, $timeout, $location, Client) {
var title = $translate.instant('terminal.title');
if (title !== 'terminal.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.config = Client.getConfig();
@@ -359,6 +356,10 @@ angular.module('Application').controller('TerminalController', ['$scope', '$tran
});
});
$translate([ 'terminal.title' ]).then(function (tr) {
if (tr['terminal.title'] !== 'terminal.title') window.document.title = tr['terminal.title'];
});
// setup all the dialog focus handling
['downloadFileModal'].forEach(function (id) {
$('#' + id).on('shown.bs.modal', function () {