I noticed that breadcrumb isn't translated when node/% page is overriden by ctools/panels.

This happens because hook_node_view is not invoked when overriding node view with panels.

In this issue's comments (https://www.drupal.org/node/1606912#comment-8318685) hook_ctools_render_alter is used to overcome this.

Maybe the following code can be added so that hook_node_view will be invoked or called and the breadcrumb will be translated.
(I'm not sure if calling or invoking the hook is preferred and why, but both worked for me)

/**
 *  Implements hook_ctools_render_alter().
 *
 *  Used to invoke/call i18n_book_navigation_node_view in case the node_view page is overriden from ctools page manager.
 */
function i18n_book_navigation_ctools_render_alter(&$info, &$page, &$context) {

  $task = $context['task'];
  if(($task['task type'] = 'page') && ($task['name'] == 'node_view')) {
    $data = array_values($context['contexts']);
    
    module_invoke('i18n_book_navigation', 'node_view',$data[0]->data,'full');
//   i18n_book_navigation_node_view($data[0]->data,'full');
  }
}

Comments

zekvyrin’s picture

Status: Active » Needs review
wadmiraal’s picture

Status: Needs review » Fixed

It's on dev. Thanks for the patch.

  • 17b63d9 committed on 7.x-2.x
    Issue #2335613 by Zekvyrin: Translate breadcrumbs when node/% is...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.