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);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | views-rows-class-1188216-1.patch | 4.34 KB | mavimo |
Comments
Comment #1
mavimo commentedPatch
Comment #2
spyros_kte commentedSimple 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.
Comment #3
Thanos Lappas commentedWorked perfect! :)
Thank you very much!!!
Comment #4
Balbo commentedI'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?
Comment #5
Sprinter commentedThank you soooo much, been struggling around for a fix for a month now, easy and works perfect.
THANKS!
Comment #6
KeepXtreme commentedthank 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
with
but again, this helps only with localized menu items, not with translated!