diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 03d0df0..f381da1 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2121,11 +2121,19 @@ function template_preprocess_page(&$variables) { ); } if (!empty($variables['secondary_menu'])) { + // Prepare secondary menu title. + $secondary_menu_heading = t('Secondary menu'); + if (theme_get_setting('features.main_menu')) { + $menu_enabled = module_exists('menu'); + $secondary_links = $menu_enabled ? config('menu.settings')->get('secondary_links') : 'account'; + $menus = $menu_enabled ? menu_get_active_menu_names() : menu_list_system_menus(); + $secondary_menu_heading = $menus[$secondary_links]; + } $variables['secondary_menu'] = array( '#theme' =>'links__system_secondary_menu', '#links' => $variables['secondary_menu'], '#heading' => array( - 'text' => t('Secondary menu'), + 'text' => $secondary_menu_heading, 'class' => array('visually-hidden'), 'attributes' => array('id' => 'links__system_secondary_menu'), ),