Actually, if primary menu is set to dropdown, menu localization don't work. Primary menu (on drop down configuration) use menu_tree function, but as explicated on http://api.drupal.org (see comment on menu_tree function page) is required to using i18n menu translation function. Please replace phptemplate_get_primary_links with this code:

function phptemplate_get_primary_links() {
  $menu = variable_get('menu_primary_links_source', 'primary-links');
  if (module_exists('i18nmenu')) {
    return i18nmenu_translated_tree($menu);
  } else {
    return menu_tree($menu);
  }
}
CommentFileSizeAuthor
#1 views-rows-class-1188216-1.patch4.34 KBmavimo

Comments

mavimo’s picture

StatusFileSize
new4.34 KB

Patch

spyros_kte’s picture

Version: 6.x-2.96 » 7.x-3.0-beta1

Simple and tested fix.

in your marinelli\theme\theme.inc

find this

$menu = $variables['menu'];

and replace with this

$menu = i18n_menu_localize_tree($variables['menu']);

I assume that you use i18n module for localization. If not this will NOT fix your issue.

Thanos Lappas’s picture

Worked perfect! :)
Thank you very much!!!

Balbo’s picture

I'm not sure where to apply the patch in #1 and where the code in the Issue Summary comes from.
I tried the fix in #2 and it is not working.
By choosing the Classic Primary Links in admin/appearance/settings/marinelli (instead of mega drop down), changing the language of the page correctly change the menu-language. When using mega drop down, instead of classic, only the menu of the second languages are shown (correct), with links to the correct language but without translation of the item of the menu.
I'll try to explain better:

About us (-> linked to node/2)
when language is italian become
Su di noi (-> linked to node/3)

With Classic Primary Links is ok, while using mega drop down:

when language is italian REMAIN

About us (-> BUT linked to node/3)

Any hint?

Sprinter’s picture

Thank you soooo much, been struggling around for a fix for a month now, easy and works perfect.

THANKS!

KeepXtreme’s picture

thank you so much!
But can anybody confirm this is only working for translation sets (different menu items for translated pages) but not for directly translated menu items to static content?

and for the theme.inc I would propose following code in line 114:
replace

$menu = $variables['menu'];

with

if (module_exists('i18n_menu')) {
        $menu   = i18n_menu_localize_tree($variables['menu']);
}
else {
        $menu = $variables['menu'];
}

but again, this helps only with localized menu items, not with translated!