From ab3202b56042c7ed65478fbbc18b9a83b4d74302 Mon Sep 17 00:00:00 2001 From: Rachel Breeze Date: Fri, 9 Aug 2019 15:25:51 +0100 Subject: [PATCH] V8: Accessibility improvements for page name entry (#5760) --- .../umbeditorcontentheader.directive.js | 21 +++++++++- .../editor/umb-editor-content-header.html | 38 +++++++++++-------- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 3 ++ .../Umbraco/config/lang/en_us.xml | 3 ++ 4 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js index 75fa0469bb6d..c82ca1481c85 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - function EditorContentHeader(serverValidationManager) { + function EditorContentHeader(serverValidationManager, localizationService, editorState) { function link(scope, el, attr, ctrl) { @@ -13,7 +13,24 @@ if (!scope.serverValidationAliasField) { scope.serverValidationAliasField = "Alias"; } - + + scope.isNew = scope.content.state == "NotCreated"; + + localizationService.localizeMany([ + scope.isNew ? "placeholders_a11yCreateItem" : "placeholders_a11yEdit", + "placeholders_a11yName"] + ).then(function (data) { + scope.a11yMessage = data[0]; + scope.a11yName = data[1]; + if (!scope.isNew) { + scope.a11yMessage += " " + scope.content.name; + + } else { + var name = editorState.current.contentTypeName; + scope.a11yMessage += " " + name; + scope.a11yName = name + " " + scope.a11yName; + } + }); scope.vm = {}; scope.vm.dropdownOpen = false; scope.vm.currentVariant = ""; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html index 37f363f50d4b..ba6714987c2c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html @@ -11,24 +11,30 @@