Commit 99794203 authored by hayashi's avatar hayashi Committed by romainj

Issue #3019298 by hayashi: Menu items for content entity show in wrong language

parent 15f34d80
......@@ -48,6 +48,10 @@ function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match)
* Implements hook_menu_links_discovered_alter().
*/
function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
$languageManager = \Drupal::languageManager();
$config_override_language = $languageManager->getConfigOverrideLanguage();
$languageManager->setConfigOverrideLanguage($languageManager->getLanguage('en'));
$moduleHandler = \Drupal::moduleHandler();
$entityTypeManager = \Drupal::entityTypeManager();
$routeProvider = \Drupal::service('router.route_provider');
......@@ -655,6 +659,8 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
'weight' => 2,
];
}
$languageManager->setConfigOverrideLanguage($config_override_language);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment