Skip to content

Commit

Permalink
Add now displaying to use-title's speak
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Dec 9, 2021
1 parent 7644e68 commit 6b38d67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/edit-site/src/components/routes/use-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ export default function useTitle( title ) {
document.title = formattedTitle;

// Announce title on route change for screen readers.
speak( document.title, 'assertive' );
speak(
sprintf(
/* translators: The page title that is currently displaying. */
__( 'Now displaying: %s' ),
document.title
),
'assertive'
);
}
}, [ title, siteTitle, location ] );
}

0 comments on commit 6b38d67

Please sign in to comment.