浏览代码

Add aria label for image toolbar.

Mateusz Samsel 6 年之前
父节点
当前提交
7e8c321f36
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 2 1
      packages/ckeditor5-image/lang/contexts.json
  2. 2 0
      packages/ckeditor5-image/src/imagetoolbar.js

+ 2 - 1
packages/ckeditor5-image/lang/contexts.json

@@ -9,5 +9,6 @@
 	"Text alternative": "Label for the image text alternative input.",
 	"Text alternative": "Label for the image text alternative input.",
 	"Enter image caption": "Placeholder text for image caption displayed when caption is empty.",
 	"Enter image caption": "Placeholder text for image caption displayed when caption is empty.",
 	"Insert image": "Label for the insert image toolbar button.",
 	"Insert image": "Label for the insert image toolbar button.",
-	"Upload failed": "Title of the notification displayed when upload fails."
+	"Upload failed": "Title of the notification displayed when upload fails.",
+	"Image toolbar": "The label describing an image toolbar attached to an image widget used by assistive technologies."
 }
 }

+ 2 - 0
packages/ckeditor5-image/src/imagetoolbar.js

@@ -44,9 +44,11 @@ export default class ImageToolbar extends Plugin {
 	 */
 	 */
 	afterInit() {
 	afterInit() {
 		const editor = this.editor;
 		const editor = this.editor;
+		const t = editor.t;
 		const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
 		const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
 
 
 		widgetToolbarRepository.register( 'image', {
 		widgetToolbarRepository.register( 'image', {
+			ariaLabel: t( 'Image toolbar' ),
 			items: editor.config.get( 'image.toolbar' ) || [],
 			items: editor.config.get( 'image.toolbar' ) || [],
 			getRelatedElement: getSelectedImageWidget,
 			getRelatedElement: getSelectedImageWidget,
 		} );
 		} );