Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Add aria-label for widget's toolbar #91

Merged
merged 11 commits into from
Aug 13, 2019
3 changes: 3 additions & 0 deletions lang/contexts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Widget's toolbar": "The label for assistive technologies used in widget's toolbar."
msamsel marked this conversation as resolved.
Show resolved Hide resolved
}
4 changes: 3 additions & 1 deletion src/widgettoolbarrepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export default class WidgetToolbarRepository extends Plugin {
*/
register( toolbarId, { items, getRelatedElement, balloonClassName = 'ck-toolbar-container' } ) {
const editor = this.editor;
const toolbarView = new ToolbarView();
const locale = this.editor.locale;
const t = locale.t;
const toolbarView = new ToolbarView( locale, { ariaLabel: t( 'Widget\'s toolbar' ) } );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. As I pointed out in Add label for editor's toolbar ckeditor5-ui#500, the ariaLabel should be a property.

  2. #register should allow customization of ariaLabel (default t( 'Widget toolbar' )).

  3. Having the above, we need PRs in

    • ckeditor5-image
    • ckeditor5-table
    • ckeditor5-media-embed

    that will correctly describe widgets introduced by the features ("Image toolbar", "Table toolbar", etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the description for PR to link changes in image, table, media-embed.


if ( this._toolbarDefinitions.has( toolbarId ) ) {
/**
Expand Down