diff --git a/src/views/notifications.js b/src/views/notifications.js index 6c378cdb8..9a27b6e2f 100644 --- a/src/views/notifications.js +++ b/src/views/notifications.js @@ -3,7 +3,7 @@ /* global async */ /* global angular */ -angular.module('Application').controller('NotificationsController', ['$scope', '$timeout', 'Client', function ($scope, $timeout, Client) { +angular.module('Application').controller('NotificationsController', ['$scope', '$timeout', '$translate', 'Client', function ($scope, $timeout, $translate, Client) { $scope.clearAllBusy = false; $scope.notifications = []; @@ -20,11 +20,15 @@ angular.module('Application').controller('NotificationsController', ['$scope', ' // collapse by default result.forEach(function (r) { r.isCollapsed = true; }); - // attempt to parse the message as json + // attempt to translate or parse the message as json result.forEach(function (r) { - try { - r.messageJson = JSON.parse(r.message); - } catch (e) {} + if (r.message.slice(0, 3) === 'tr:') { + r.message = $translate.instant(r.message.slice(3)); + } else { + try { + r.messageJson = JSON.parse(r.message); + } catch (e) {} + } }); $scope.notifications = result;