From 3660a92725fae4358fdf32e7931000f84c0eb8dd Mon Sep 17 00:00:00 2001 From: Erik <11491369+kebbet@users.noreply.github.com> Date: Mon, 13 Dec 2021 13:48:22 +0100 Subject: [PATCH] Remove 4 instances of 'gutenberg' text domain from WordPress core (#37229) * Remove text domain, set string once. Use sprintf() to combine the string with the $label. * Remove text domain, set string once. Use sprintf() to combine the string with the $label. * Update variable name and translator text. Thanks for feedback! * Update variable name and translator comment. Thanks for feedback! --- .../block-library/src/navigation-submenu/index.php | 10 ++++++++-- packages/block-library/src/page-list/index.php | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/navigation-submenu/index.php b/packages/block-library/src/navigation-submenu/index.php index c0fdbfa271cfa..60485079897ca 100644 --- a/packages/block-library/src/navigation-submenu/index.php +++ b/packages/block-library/src/navigation-submenu/index.php @@ -188,6 +188,12 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { ); } + $aria_label = sprintf( + /* translators: Accessibility text. %s: Parent page title. */ + __( '%s submenu' ), + $label + ); + $html = '
  • '; // If Submenus open on hover, we render an anchor tag with attributes. @@ -226,11 +232,11 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { if ( $show_submenu_indicators ) { // The submenu icon is rendered in a button here // so that there's a clickable elment to open the submenu. - $html .= ''; + $html .= ''; } } else { // If menus open on click, we render the parent as a button. - $html .= ''; } else { $markup .= '' . $title . ''; @@ -186,7 +191,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click, if ( isset( $page['children'] ) ) { if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) { - $markup .= ''; }