I ran into a problem on a multilingual site where we have 2 languages, and a separate menu for each languages, like we always set it up.
There are 3 pages using views to show a collection of items. The links of these pages are exactly the same for both languages, as is common with views.

This resulted in the breadcrumb titles being always FR or always NL, depending on which menu was the highest in the hierarchy settings (Enable / Disable Menus) of the menu_breadcrumb module.

I wrote a patch to take the current language into account when determining what menu item to set as active. Note that all of your menu items must have a language set using i18nmenu module. A new setting is added in the config of the module to take languages into account. The setting will only be active if you have the i18nmenu module active.

The patch works, but I don't like my solution. Alot more work would be needed to to a proper i18n integration here, in my humble opinion. Never the less, I would like to contribute it as it might be helpful to come up with a proper solution.

CommentFileSizeAuthor
menu_breadcrumb_lang.patch4.06 KBmalc0mn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dboulet’s picture

What I did to work around this problem is to set 'menu_breadcrumb_menus' as a multilingual variable in my settings.php file. This way I was able to enable/disable different menus for different languages.

rapsli’s picture

#1 works just fine. Thanks

harrrrrrr’s picture

#1 works fine idd

ranx’s picture

I have the same problem with the 7.x version of the module. I don't have separate menus for separate languages but have localized some of the menu items.

Obviously the patch for 6.x does not work for me. Nor does the suggestion in #1. Multilingual variable arrays in settings.php have no more effect. Modules wanting to use multilingual variables must now implement the variable_info hook. Sadly I'm not a programmer and don't have necessary skills to do that. Any help would be greatly appreciated.

grimmlink’s picture

subscribed

Using main menu for one language and a custom menu for another language, I can't figure out why the breadcrumb (and the active trail) won't work on the view pages when working on any other page..

If somebody can help ?

2dareis2do’s picture

#4 - same problem here - need to add support for drupal 7 and multi language?

2dareis2do’s picture

Was recommended this module for use with views in a multi language setup.

i18n page views - http://drupal.org/project/i18_page_views

More info here

http://hojtsy.hu/blog/2011-nov-19/drupal-7s-new-multilingual-systems-par...

This could help you fix your breadcrumb issue. D7 though.

xurizaemon’s picture

I'd like to see these three Menu Breadcrumb issues fixed in the next release.

* #400748: Incorrect breadcrumb when multilingual node appears in menu more than once
* #717100: Problem with multilingual site and multiple menu's with same links
* #1054202: Hide the breadcrumb if the breadcrumb only contains the link to the front page not working with i18n menu.

In order to do that I'd like to get fixes tested and reviewed for all of them.

The release co-ordination issue is #1827248: Release co-ordination for Menu Breadcrumb 6.x-1.4 and 7.x-1.4. Aiming to release in a month from today. If you're interested in getting these fixes in, now is the time to patch or review these issues.

guysaban’s picture

for #4

I have three separate menus to control breadcrumbs and also have the issue.

We need to have an option that allows assigning a distinct menu for each language.

Did you find a solution?

bat00’s picture

HI,

I have a similar issue: my D7 site is in english and french, with a menu per language, and a path defined in a module. The only solution I found is:

I define my custom path this way:

function mymodule_menu()
{
    $items['news'] = array(
        'page callback'		=>	'mymodule_page_callback',
        'access callback'	=>	true,
        'type'			=>	MENU_CALLBACK,
        // The page title will be set directly in the menu item
    );
    
    return $items;
}

Then I force Drupal to take the good menu depending on the current language, thanks to the function "menu_set_active_menu_names". Here's a simplified version of my function :

function mymodule_init()
{
    global $language;
    if ($language->language === 'en')
    {
        menu_set_active_menu_names(array('menu-en'));
    }
    elseif ($language->language === 'fr')
    {
        menu_set_active_menu_names(array('menu-fr'));
    }
}

Note that I have defined menu-en as source for the main links in english, and menu-fr for french, with the variable translation module. I don't have any other breadcrumb module, context or custom hook which could alter or override the default Drupal behaviors.

I'm not pretty sure if it's the best way to solve this issue. Anyway, it works.

xurizaemon’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Cleaning up issue queue. Closing all D6 issues.

If you believe this issue still applies to a supported version, feel free to re-open it. That would be a great time to check if the issue contains clear steps for reproducing the bug!

Thanks and sorry for any inconvenience.