Closed (duplicate)
Project:
Internationalization
Version:
7.x-1.x-dev
Component:
Menus
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jul 2011 at 22:49 UTC
Updated:
4 Sep 2012 at 20:14 UTC
We found this bug in mode I18N_MODE_MULTIPLE...
It seems, the menu link items don't get localized. While searching for the reason i found:
function i18n_menu_localize_tree($tree, $langcode = NULL) {
...
// If the title is the same it will be localized by the menu system.
if ($link['link_title'] != $router['title']) {
$item['link']['title'] = _i18n_menu_link_title($link, $langcode);
}
...
}
I think the upper line checking for "!=" should be:
if ($link['link_title'] == $router['title']) {
Is this really checking wrongly by accident?
Comments
Comment #1
jmones commentedsubscribe
Comment #2
jose reyero commentedAs the comment reads, in the == case, it will be localized by the (core) menu system using t(). This is about menu items generated by modules.
See http://api.drupal.org/api/drupal/includes--menu.inc/function/_menu_item_...
So do you get custom menu items not localized?
Comment #3
jose reyero commentedFeel free to reopen with more information.
Comment #4
ClaudeS-1 commentedThe problem isn't with the test, it's with the assignment of the translated link title back to the $item
The original link_title is stored in $item['link']['link_title'], but the code puts the translation in $item['link']['title']
I presume this has gone unnoticed by so many people because menus maybe incorrectly use $item['link']['title'] to display the title?
See this thread for more info:
http://drupal.org/node/1165472#comment-4506344
Comment #5
vidorado commentedI don't know if my problem is related to this issue, but i'm also getting untranslated link titles in the breadcrumb. I can assure that the breadcrumb is not being altered by other modules because i disabled them all. The menu items are showing properly translated when i show the menu with Superfish or with Menu Block.
I fixed the problem with this alter function in a custom module:
¿Maybe i18n module would have to alter the breadcrumb too, like my module does?
Comment #6
jose reyero commentedThese and other related issues may be fixed by this patch, #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
Please give it a try.