Hello, I have installed Drupal 5.6 with WIMP with Garland theme. I add and activated the modules:
Locale
Multilanguage - i18n
Multilanguage - i18n - experimental
Menutranslation

All is working fine so far.

But my 'Primary links' do not work with Multilanguage.

I create a Multilingual Block, I called it 'Primary Links Multilingual' and add to this Multilingual Block the blocks Primary Links and Hauptlinks (for German language).

In Block specific settings I select for English the block Primary links(menu) and for German Hauptlinks(menu)

I do not set a Region for that Multilingual Block because I want to use it with Garland Theme below the header on the right top of the page.

After I click on on 'Save Blocks' it works only once! This means that in English language it shows me the Primary links on the top right the appropiate Primary links and after choosing German it shows me the 'Hauptlinks' with the appropiate German links.

I had set for Primary links the sublink e.g. Contact and for German Hauptlinks the sublink 'Kontakt'.

But after changing again the language it do not show me the appropiate German Primary links (Hauptlinks) but it shows me the standard: Hauptlinks bearbeiten (Edit Primary links).

I deleted all and set up again and again, but I couldn't get it working probably.

I am wondering that I cannot in 'Menues' -> 'Settings' I cannot add in the drop down box 'Menu containing primary links:' the 'Primary links multilingual' I created. It is not in the list to select. So I choose there 'Primary links' or I tried it also to select there 'Hauptlinks'

I deleted all and set up again, and again but I cannot get it working probably. What am I doing wrong? Please help.

Comments

drupal4normi’s picture

Is this issue unique? Isn't there anyone with knowledge about this issue?

Dmi167’s picture

Look this: http://drupal.org/node/313302
And this: http://groups.drupal.org/node/13092#comment-56417 (last comments)
I think that is exactly what you looking for.

Most of the themes display Primary Links and Secondary Links directly instead of using a block so for this case the i18n's multilingual menu items features won't work.
To fix it I changed the template of the theme. It is possible to add language dependent variables. But I didn’t experiment with them.

1) For Garland theme add the following code in the template.php file in the phptemplate_preprocess_page(&$vars) function :

  $current_language = $vars['language']->language ;
  foreach ( array('primary_links', 'secondary_links') as $menu_name ) {
    if (! empty($vars[$menu_name])) {
          foreach ( $vars[$menu_name] as $menu_key => $menu_item ) {
                  if ( $menu_item['langcode'] != $current_language && ! empty($menu_item['langcode']) ) {
                          unset($vars[$menu_name][$menu_key]) ;
                  }
          }
    }
  }

Here remained all current language menus and language independent menus.

2) For Acquia Marina theme it is not enough. Because this theme using Drupal API function “menu_tree”. So I modified this function straight in the page.tpl.php file.
Changed one string of code:

  print menu_tree($menu_name = 'primary-links');

On this one:

  // Overloaded "menu_tree" function to support multilingual primary links
  $menu_name = 'primary-links';
  
  static $menu_output = array();
  
  if (!isset($menu_output[$menu_name])) {
    $tree = menu_tree_page_data($menu_name);
    
    // Leave only current language menus and language neutral menus
    $current_language = $language->language;
    if ( ! empty($tree) ) {
      foreach ( $tree as $menu_key => $menu_link ) {
            if ( $menu_link['link']['options']['langcode'] != $current_language &&
                 ! empty( $menu_link['link']['options']['langcode'] ) ) {
              unset( $tree[$menu_key] ) ;
            }
      }
    }
    
    $menu_output[$menu_name] = menu_tree_output($tree);
  }
  print_r ($menu_output[$menu_name]);

In general this is the same like in point (1), but with knowledge of menu tree structure.