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.
You can use following code snippet for book navigation block in your module/theme if you want to hide the links that are not of the page's language.
/**
* Implements hook_block_view_MODULE_DELTA_alter
*/
function ModuleOrThemeName_block_view_book_navigation_alter(&$data, $block) {
global $language;
$site_lang = $language->language;
foreach ($data['content'] as $key => $value) {
if ($key != '#theme') {
$mynode = node_load($key);
$link_lang = $mynode->language;
//Site Language is different from Link language
if ($site_lang != $link_lang) {
unset($data['content'][$key]);
}
}
}
}