When an external link is inserted into the secondary links menu, this menu item is displayed in all i18n languages. When the path is changed to an internal node link, the items are displayed correctly. It seems that the links are displayed according to the language parameter on the path the item is linking to?

Comments

giorgosk’s picture

Title: Language choice on external secondary links » Language choice on menu items not working

In my case it behaves this way regardless of links being internal or external
similar or related issues might be #1146692: menu items language selecting not working

Don't know if this is the problem of i18n or core drupal

here is a temp solution that I found to be working (since I got lost diging in drupal core / i18n files with my debugger)

override theme_menu_item_link in template.php

function phptemplate_menu_item_link($link) {
  global $language;
  if (empty($link['localized_options'])) {
    $link['localized_options'] = array();
  }
  if(isset($link['options']['langcode']) && $language->language != $link['options']['langcode'] )
    return "";

  return l($link['title'], $link['href'], $link['localized_options']);
}

clear cache and it should work

giorgosk’s picture

Version: 6.x-1.0 » 6.x-1.9
jose reyero’s picture