Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
i hacked the menutrails.module to get localized breadcrumbs. Just replace the function:
function _menutrails_recurse_crumbs($tree, $item, &$crumbs, $above = array()) {
foreach ($tree as $menu_item) {
if (!$menu_item['link']['in_active_trail']) {
continue;
}
if ($menu_item['link']['link_path'] == $item['href']) {
foreach ($above as $trail_item) {
if (module_exists('i18n')) {
$router = i18nmenu_get_router($trail_item['link']['link_path']);
if ($trail_item['link']['link_title'] != $router['title']) {
$trail_item['link']['link_title'] = _i18nmenu_get_item($trail_item['link'], false);
}
}
$crumbs[] = l($trail_item['link']['link_title'], $trail_item['link']['link_path']);
}
if (module_exists('i18n')) {
$router = i18nmenu_get_router($menu_item['link']['link_path']);
if ($menu_item['link']['link_title'] != $router['title']) {
$menu_item['link']['link_title'] = _i18nmenu_get_item($menu_item['link'], false);
}
}
$crumbs[] = l($menu_item['link']['link_title'], $menu_item['link']['link_path']);
break;
}
if (is_array($menu_item['below'])) {
_menutrails_recurse_crumbs($menu_item['below'], $item, $crumbs, array_merge($above, array($menu_item)));
}
}
}
Comment | File | Size | Author |
---|---|---|---|
#3 | 829204.patch | 1.1 KB | weseze |
Comments
Comment #1
Wolfgang Reszel CreditAttribution: Wolfgang Reszel commentedOops, wrong project.
Comment #2
Wolfgang Reszel CreditAttribution: Wolfgang Reszel commentedHere the modified function for the latest i18n module:
Comment #3
weseze CreditAttribution: weseze commentedThis really needs to be fixed. I have to manually apply this patch to all sites and after all updates to this module.
Patch included ;) thx Tekl!
Comment #4
fabianderijkThis patch works fine for me. It's important to implement this in the module.