It's working fine with Bartik but the problem is when I switch to fusion.
When I translate the front page I have both links in the main menu.

Title is Home - Path is <front> - Language is English
Title is Accueil - Path is <front> - Language is French
The result in Fusion is:
In the english main menu I have "Home - Accueil - About us - Contact us"
In the french main menu I have " Home - Accueil - À propos de nous - Contactez-nous"

Any idea how to get that works in Fusion?

Thank you,

Comments

stephthegeek’s picture

Status: Active » Postponed (maintainer needs more info)

I haven't worked with multilingual in D7 yet, but the main difference in menus between the two is that Fusion uses a main menu region while Bartik prints it out as a variable in the template. I'm not sure why that would affect this, but it might give someone a starting point. Strange that only *one* item would be duplicated.

Are you using superfish?

Swebmas’s picture

I did not use Superfish. I have the same duplication for the "contact" page because it is not generate by cck. Only page like front, contact, forum get duplicated.

aquariumtap’s picture

I haven't been able to replicate this, exactly.

What was your method for translating a menu, Swebmas? This is my first time doing multilingual in D7, so I have to learn that before debugging the problem in Fusion.

For me in Fusion, toggling between English/French does not change the language of my "main menu" block. I'm not getting duplicates -- but I'm not seeing the switch ata ll.
In Bartik, the toggle is working as would be expected.

aquariumtap’s picture

Status: Postponed (maintainer needs more info) » Active
Swebmas’s picture

First, I'm using the module i18n 7.x-1.0-beta4. You need to activate some modules before you can activate the menu translation.

If you don't have another language yet, you add it here: admin/config/regional/language

In the configuration admin/config/regional/language/configure you can select some detections. I enabled "URL"
In the configuration admin/config/regional/i18n/variable you select "Source for the Main links".

You should now have language options in the menu. You can edit the home link and select english as language. Then to add a translation to the home you create a new link. Name it "Accueil" link is <front> and select french as language.

For the english "Home", the URL should be domaine.com/en
For the french "Accueil", the URL should be domaine.com/fr

pardalman’s picture

Got the same problem using Bluemasters theme in a testing site: D7.2+i18n-7.x-1.0-beta7.tar
Just in case it helps or anyone could give me a hint.

I have this problem not only with Home but also with Contact page.

pardalman’s picture

WORKAROUND TO SOLVE IN BLUEMASTER THEME

Just in case this code snippet helps anyone I have solved this issue by deleting manually the elements of the menu that are duplicated editing the page--front.tpl.php of the Bluemasters theme:

//Read of the current language of the user
global $language;
$idiomaActual= $language->language; 
aquariumtap’s picture

Status: Active » Closed (cannot reproduce)

Upgrading the i18n module to the 7.x-1.0-rc1 release should correct this issue.

pardalman’s picture

I've upgraded i18n module to 7.x-1.0-rc1 and keeps not working...
Using Bluemasters theme.

This is the part where the menu is printed on screen, any hint? (solving this would save some cpu cicles and some of my nerves when editting the file every time I change the order of my menu links)
XD

        <!--navigation-->
        <div id="navigation">
			<?php $menu_name = variable_get('menu_main_links_source', 'main-menu');			
            $main_menu_tree = menu_tree($menu_name); 					
            print drupal_render($main_menu_tree); ?>
        </div><!--EOF:navigation-->
aquariumtap’s picture

Hi pardalman, you should ask the maintainers of the Bluemasters theme. It isn't a subtheme of Fusion.

pardalman’s picture

Definitely,
Sorry!

Asw20’s picture

Hello,

I have the same issue.
"Curriously" I have this issue if I use a dropdown menu like superfish with Danland or Mega Drop Down with Marinelli theme.
In the other hand if I use the standard menu I don't have a dropdown menu...

Menu items linked with a content work well, if the content is in english the menu will show up only when the language is set in english.

I still have probleme with menu related to the page or with a fonction like user/login ...

I might be wrong but for me the problem is soemwhere in the menu.inc when using menu_tree_all_data which select menu item with a wrong language code or in the i18n which should remove language code other than null ?

Asw20’s picture

I fixed it !

The following fix did correct superfish menu and other like Mega Drop Down. My language detection setup is user , Browser, then default.

File menu.inc
function _menu_build_tree (not menu_build_tree)

Add the following condition:
$query->condition('ml.language', array(LANGUAGE_NONE, $GLOBALS['language']->language), 'IN');

here is the code of this section

if (!isset($trees[$tree_cid])) {
    // Select the links from the table, and recursively build the tree. We
    // LEFT JOIN since there is no match in {menu_router} for an external
    // link.
    $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
    $query->addTag('translatable');
    $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
    $query->fields('ml');
    $query->fields('m', array(
      'load_functions',
      'to_arg_functions',
      'access_callback',
      'access_arguments',
      'page_callback',
      'page_arguments',
      'delivery_callback',
      'tab_parent',
      'tab_root',
      'title',
      'title_callback',
      'title_arguments',
      'theme_callback',
      'theme_arguments',
      'type',
      'description',
    ));
    for ($i = 1; $i <= MENU_MAX_DEPTH; $i++) {
      $query->orderBy('p' . $i, 'ASC');
    }
    $query->condition('ml.menu_name', $menu_name); 

// Nr001 Only look menu links with none or the current language.
$query->condition('ml.language', array(LANGUAGE_NONE, $GLOBALS['language']->language), 'IN');

    if (!empty($parameters['expanded'])) {
      $query->condition('ml.plid', $parameters['expanded'], 'IN');
    }
    elseif (!empty($parameters['only_active_trail'])) {
      $query->condition('ml.mlid', $parameters['active_trail'], 'IN');
    }
maxxer’s picture

Can confirm fix in #13 seems to working in Zen subtheme, with custom menus assigned to blocks.
1st: thank you to Asw20 :)
2nd: seems odd we have to hack core here, no? Other readings suggest this really shouldn't be an issue in D7 with new(er) versions of i18n.

gynekolog’s picture

works perfect, thank you

emorency’s picture

Have a look at that issue http://drupal.org/node/1021462 that is referring to a solution that does not require to hack drupal core:

http://drupal.org/node/1225094

- Etienne

themaurice’s picture

#13 thanks Asw20 works well with superfish menu.