I have been struggling to understand how i18n menu translation is intended to work in Drupal 6.... I was hoping someone could confirm what I think I have discovered....

It seems that:

1. Only custom menu items appear in the 'translate interface' list, not primary/secondary links

2. Although custom menu items do go through the translation engine, this does not help if you translate the node pointed to by a menu item ..... because ......

3. A menu item has to be created for every language (I thought I might be able to use URL aliases to avoid having to create a new menu item for each language, but I could not get this to work)

also .....

4. A menu item is selectively shown/hidden to the user depending on the language of its target .... so although the menu item itself has a "language" dropdown, it doesn't actually do anything (surely it does something? I can't find any affect of changing it!)

Can anyone help with a sanity check on these conclusions?!

Thanks!

Comments

raqiro’s picture

I have exactly same questions!

BloodyNO’s picture

Because I'm also completely in the blue...

purrin’s picture

I'd like to learn more about this, myself...

-=- christopher

EdinburghRob’s picture

I'd love to know too.

sharonov’s picture

And me :)

Jan Van Hyfte’s picture

I have another issue with my multilingual site: All works fine, except that all menus in all languages appear as soon as I open the /POLL or /FORUM modules. If I choose another node via the menu, the menu again appears only in 1 language. Any hint?

Jan Van Hyfte’s picture

The solution is simple:

goto admin/settings/i18n and choose for "Only current language and no language ". This will only show the "active" language...

RTFM, if you find it !!!

abhishekdrupal’s picture

I am using drupal-6.16 i used i18n but it doesnot allow me to go to admin page it gets stucked.

distanceroller’s picture

I think this is the right path for that option.

admin/settings/language/i18n

Cheers

lionalx’s picture

:(

jmashaw’s picture

I would like to know if there are any resources which will show how to do this, too. Thanks.

http://jmashaw.com

Z2222’s picture

You need this module:
http://drupal.org/project/i18n

andr’s picture

Unfortunately, I know PHP superficially, but I can not understand, why throughout long time the question for translating points of the horizontal menu (Primary links) has not been solved yet. I have spent a lot of time by solving this question, have found out the reason, and dear gurus pls help. This decision wait very many people. It is simple enough, but it is necessary to know PHP.
So, if you use additional modules i18n and transliteration in Drupale 6, Primary links menu works perfectly in any region, except translation of points in the horizontal menu, irrespective of the fact, which language is accepted as first language. Personally for me the first language is - Russian. The problem only with horizontal menu Primary links the path (Home "Administer" Site building "Menus" Primary links) there are only 3 items (List items =Add item = Edit menu), but should be (List items = Add item = Edit menu=Translate), and in an initial working code (in particular for me) should be the next expression:

  • Переводы
  • Many thanks

    joergvk’s picture

    Many themes show the primary and secondary links in what you describe as a "horizontal" menu. But if the theme doesn't call the proper translation functions, you will never see a translation in what the theme renders. If your primary and secondary links are translated when they are shown as a block, but not when they are displayed outside a region (a region is where you can put blocks), the code in the theme is the issue to solve. Or use another theme that does it right.

    Hope this helps.

    andr’s picture

    sorry, the end was cut!

    The problem only with horizontal menu Primary links the path (Home "Administer" Site building "Menus" Primary links) there are only 3 items (List items =Add item = Edit menu), but should be (List items = Add item = Edit menu=Translate), and in an initial working code (in particular for me) should be the next expression:

  • Переводы
  • Many thanks

    andr’s picture

    The problem was with HTML

    Unfortunately, I know PHP superficially, but I can not understand, why throughout long time the question for translating points of the horizontal menu (Primary links) has not been solved yet. I have spent a lot of time by solving this question, have found out the reason, and dear gurus pls help. This decision wait very many people. It is simple enough, but it is necessary to know PHP.
    So, if you use additional modules i18n and transliteration in Drupale 6, Primary links menu works perfectly in any region, except translation of points in the horizontal menu, irrespective of the fact, which language is accepted as first language. Personally for me the first language is – Russian. The problem only with horizontal menu Primary links the path (Home "Administer" Site building "Menus" Primary links) there are only 3 items (List items =Add item = Edit menu), but should be (List items = Add item = Edit menu=Translate), and in an initial working code (in particular for me) should be the next expression:
    (

  • Переводы
  • )
    Many thanks

    andr’s picture

    Unfortunately, I know PHP superficially, but I can not understand, why throughout long time the question for translating points of the horizontal menu (Primary links) has not been solved yet. I have spent a lot of time by solving this question, have found out the reason, and dear gurus pls help. This decision wait very many people. It is simple enough, but it is necessary to know PHP.
    So, if you use additional modules i18n and transliteration in Drupale 6, Primary links menu works perfectly in any region, except translation of points in the horizontal menu, irrespective of the fact, which language is accepted as first language. Personally for me the first language is – Russian. The problem only with horizontal menu Primary links the path (Home "Administer" Site building "Menus" Primary links) there are only 3 items (List items =Add item = Edit menu), but should be (List items = Add item = Edit menu=Translate), and in an initial working code (in particular for me) should be the next expression:
    #

  • Переводы
  • Many thanks

    andr’s picture

    Unfortunately, I know PHP superficially, but I can not understand, why throughout long time the question for translating points of the horizontal menu (Primary links) has not been solved yet. I have spent a lot of time by solving this question, have found out the reason, and dear gurus pls help. This decision wait very many people. It is simple enough, but it is necessary to know PHP.
    So, if you use additional modules i18n and transliteration in Drupale 6, Primary links menu works perfectly in any region, except translation of points in the horizontal menu, irrespective of the fact, which language is accepted as first language. Personally for me the first language is - Russian. The problem only with horizontal menu Primary links the path (Home "Administer" Site building "Menus" Primary links) there are only 3 items (List items =Add item = Edit menu), but should be (List items = Add item = Edit menu=Translate), and in an initial working code (in particular for me) should be the next expression:
    I delete here the tag li >Переводы

    Many thanks

    andr’s picture

    I suppose the guru undestand the problem.
    But for future, how to pass HTML code to be readable in the comments

    abaddon’s picture

    check these
    http://drupal.org/node/313272
    http://drupal.org/node/313302
    and this
    http://groups.drupal.org/node/13092#comment-56417

    2 solutions, im currently using #2 but i guess it depends on taste.. #1 doesnt hack any theme files so easier to upgrade huh?

    andr’s picture

    to: abaddonsun - November 9, 2008 - 05:27

    Many thanks. The problem is solved and it is quite easy. When I set up ('menu_primary_links_source',) in settings.php the menu item disappeared and I delete it 'menu_primary_links_source',. So, I have spent a lot of time by finding solution and using different proposals without any result. The key is particularly in this variable. Next should be the pointing menu items in appropriate language (admin/build/menu/settings). I am very busy, but in a few days, I`ll try to write about translations: menu, content, site name and others. My English is not quite OK, so pardon and all will be pointed in my blog in Russian on http://drupal.ru nickname anpal. Best regards

    -Anti-’s picture

    > although the menu item itself has a "language" dropdown, it doesn't actually do anything

    This works for blocks, but it seems broken for menu items.
    And I wonder why we can't select the language for a whole menu? Why only for blocks or menu items?

    Also, can anyone explain why 'my account' changes to 'mi cuenta' when switching to spanish, but 'Create content', 'blog entry', 'forum topic', 'page' and 'story' don't change, even though they *do* have string translations, and have exactly the same menu settings as 'my account'? I can't work out why they're not changing, except that the language implementation is a buggy PoS at the moment.

    dckantor’s picture

    For some reason a lot of the translation of primary and secondary menus works better if you create the menu items through the content creation interface. For example:

    create page 1en and while creating it make a link to it in the primary menu
    create translation 1es and create it's link in the primary menu
    create page 2en and while creating it make a link in primary menu
    create translation 2es ......

    when created this way the menus and pages all seem to work fine. If you try to create the menu from the menu admin you get lots of problems and limited translation options. NOTE: when in admin all languages show up but when logged out of admin then switch properly.

    take a look at:
    http://drupal.org/node/275705

    I have i18n module installed and I think that may be coming into play but I'm not sure. It's hard to tell what translation capabilites come from core Locale and what comes from i18n

    -Anti-’s picture

    > For some reason a lot of the translation of primary and secondary menus works better if you create the menu items through the content creation interface.

    Thanks for the advice.

    dckantor’s picture

    Can anyone figure this out? I have a single menu used as the source for 1˚ and 2˚ links. The menu is in 3 languages and all three show up just when they are supposed to in inline style at the top of the various themes I've tried. The English version also shows up in the sidebar if I specify to show it in that block but when I switch languages the other langs do not show up in the sidebar. Any ideas?

    dckantor’s picture

    needed to set the menu to all languages

    AltoRetrato’s picture

    I'm using Drupal version 6, and it makes translating your site to be more complicated than it should. I found that the Translation Table module can help you with that, so if anyone is interested, you should take a look.

    babak_vandad’s picture

    Well, I had encountered a similar problem: I’m using drupal 6 with nice_menus and i18n module applied. Everything looks fine, when I add a new page, and translate it in different languages it works all right. But the problem is when I add a custom menu for a specific language.

    It simply didn’t work, and the menu item appeared in every language! No redeem explained in this thread or other places helped.

    I’m using a theme other than default themes. So those solutions which edit the code of themes didn’t work for me so far.
    My solution was very simple by editing the nice_menus code as follows:

    function theme_nice_menu_build($menu) {
    
      foreach ($menu as $key => $menu_item) {
        $opt = $menu_item ['link']['options'];
        if (isset ($opt ['langcode']) && $opt ['langcode'] != i18n_get_lang())
          unset ($menu[$key]);
      }
    
      $output = '';
    
      foreach ($menu as $menu_item) {
      ...
    

    This code removes irrelevant menu items.

    I'm new to drupal; just 2 weeks. So for sure there are some better solutions.

    slourc’s picture

    an easier way without any module added.

    1- create a menu for each language,
    2- add all the menus in the block where you want it to be displayed,
    3- for each menu edit the configuration of the element in block page,
    4- select the radio button " Show if the following PHP code returns TRUE (PHP-mode, experts only). ",
    5- in the field below the radion button, add the following text:

    <?php 
    global $language;
    return $language->language=="<COUNTRY_CODE>"; 
    ?>
    

    Where <COUNTRY_CODE> is equal to the 2 digit country code of the language. For instance en for english, it for italian, fr for french etc ...

    bjste’s picture

    Did anyone find a good solution?

    I'm also struggeling with translation of the horizontal primary menu.
    My Danish menu works out fine, but when I hit the english flag there is no english menu, and I can't figure out why!
    The english menu items do excist in the primary links menu: admin/build/menu-customize/primary-links...

    abaddon’s picture

    see my comment above http://drupal.org/node/244752#comment-1099237
    problem is the primary menu is generated through the theme and not the block layer, and the theme does not take care of i18n stuff, or you could generate your primary menu via a block

    xalexas’s picture

    Solution for easiest menu translation is to set menu language to "all languages" and then translate menu items through Translate interface (admin/build/translate). I guess that everyone here was looking for that.

    bjste’s picture

    Woha ... I think I stubmled over the solution....
    I18n has too many bugs if you ask me.. I would have loved to find this solution at the beginning - would have saved me quite a lot of troubles and work.
    (making two menues and trying to hack arround and make things work).

    http://drupal.org/node/313272

    jsartin’s picture

    Now when I have it set to use path prefix and I translate menus, my menus are fine in English, but they don't expand to the active trail in other languages. Any ideas?

    bawoor’s picture

    for all solutions, use this module
    http://drupal.org/project/gtranslate

    ꦱꦠꦽꦶꦪ

    Anonymous’s picture

    How is the navigation menu handled then? (It's not primary nor secondary).

    The extracted .po file doesn't appear to contain the items in this menu nor the hover text.

    I know that I can simply edit the menu items and type in an alternative text (the site is to be launched solely with the base language other than English and no need to revert back) but how do I edit the hover texts?

    Why is it that some are using UTF8 encoding and therefore special characters display correctly but others show the html instead of the correct letter?

    plach’s picture

    Ingotian’s picture

    I have just struggled through how to do multiple languages for menu translations and it cost me quite a bit of time to figure out. I have put a blog entry at https://theingots.org/community/node/27111 to explain how I got it to work in case it helps anyone else.