diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/html/umbbox/umbboxheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/html/umbbox/umbboxheader.directive.js index a0fbd2c24a..21f0c33de5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/html/umbbox/umbboxheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/html/umbbox/umbboxheader.directive.js @@ -45,7 +45,7 @@ Use this directive to construct a title. Recommended to use it inside an {@link (function(){ 'use strict'; - function BoxHeaderDirective() { + function BoxHeaderDirective(localizationService) { var directive = { restrict: 'E', @@ -57,6 +57,26 @@ Use this directive to construct a title. Recommended to use it inside an {@link title: "@?", descriptionKey: "@?", description: "@?" + }, + link: function (scope) { + + scope.titleLabel = scope.title; + + if (scope.titleKey) { + localizationService.localize(scope.titleKey, [], scope.title).then((data) => { + scope.titleLabel = data; + }); + + } + + scope.descriptionLabel = scope.description; + + if (scope.descriptionKey) { + localizationService.localize(scope.descriptionKey, [], scope.description).then((data) => { + scope.descriptionLabel = data; + }); + + } } }; @@ -66,4 +86,4 @@ Use this directive to construct a title. Recommended to use it inside an {@link angular.module('umbraco.directives').directive('umbBoxHeader', BoxHeaderDirective); -})(); \ No newline at end of file +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/components/html/umb-box/umb-box-header.html b/src/Umbraco.Web.UI.Client/src/views/components/html/umb-box/umb-box-header.html index e9f771f09c..bff03f8855 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/html/umb-box/umb-box-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/html/umb-box/umb-box-header.html @@ -1,13 +1,11 @@
-
- - {{title}} +
+ {{titleLabel}}
-
- - {{description}} +
+ {{descriptionLabel}}
-
\ No newline at end of file +