Community Documentation

Menus and primary / secondary links

Last updated November 5, 2012. Created by mr.baileys on September 25, 2008.
Edited by frederickjh, Kristen Pol, totsubo, jvandyk. Log in to edit this page.

With Drupal 6 core alone, user-defined menu items are not translatable. The Menu translation (i18nmenu) module, part of the Internationalization (i18n) package, provides the following features:

  • Allows setting a language when creating a custom menu item so that the menu item will only show up for that language.
  • Localizes other custom menu items without language. It does this by adding a "Limit search to: Menu" option on the Search tab of the Translate interface at Administer > Site building > Translate interface.

A menu item linked to a node, due to how the menu system works and the 'Language selection' feature in the Internationalization module, will be displayed only when the node language matches the page language. The Menu translation module relies on theming and blocks for displaying the right links for each case. Thus for uses different than displaying the menu in a block, it may not always work.

About primary / secondary links

This is a special case, as they're basically menus that can be displayed as a block but aren't always. Most of the themes display them directly instead of using a block so, for this case, the Internationalization module's multilingual menu items features won't work.

The alternate and recommended approach for having different primary / secondary links for each language is:

  1. Enable language-dependent variables. The one needed for this is 'menu_primary_links_source' for primary links and 'menu_secondary_links_source' for secondary links.
  2. Create as many menus as languages in Administer > Site building > Menus > Setting. Set up the links for each language.
  3. Set up the menu to be used for each language in Administer > Site building > Menus > Settings. You will need to switch languages while on this page.

Comments

also see

also see http://groups.drupal.org/node/13092#comment-56417 for a theme hack approach..

See "Translation Table" module

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.

You can also simply use the

You can also simply use the 'translate interface' built in drupal. It's very efficient

Easiest way

You are right. Solution for easiest menu translation is to set menu language to "all languages" and then translate menu items through Translate interface (admin/build/translate).

Translation table module

Translation table module worked for me. Give it a try.

Translation Table doesn't

Translation Table doesn't work for me, seems broken, I have filled a bug report.

But, what about links? I can

But, what about links?
I can translate "legal notice" to "aviso legal", but both links to the same page "node/X" instead of "node/X" for english and "node/Y" for spanish. How can I manage that?

Stumped

Did you find a working solution? On our old D5 site it was working like that, but I can't replicate it on the D6 site.

Why menu can't link to the node?

Plz help me. My English is poor, so sorry if I couldn't say clearly.

After built a bilingul(En/Chinese) site in my notebook based on LAMP, I uploaded code and database to the server based on LNMP. There was error that lingual switch block can't link to chinese page ,display 'Page not found', en links were good.

So I build site on server from very beginning, I follow the procedrue in the Handbook, but error still appears. I can't decide where is bug, Does anybody meet similar problem?

Thank you for the excellent handbook!

The handbook for this module is awesome, I got everything done as planned, with the help of this manual.
The module is great, and so is the documentation for it.

Thank You.

Kindest regards,
MerjaS

MerjaS
www.gurux.org
------------------
Drupal 6.22
MySQL database 5.0.77
PHP 5.2.8
server Microsoft-IIS/7.0

views compatibility?

is it just me or the views module is not compatible with this. creating a page for a display and assigning the new menu created for the language is simply not working :(

/*edited*/

sorry guys the problem seems to be with my theme..new menus are working only for garland..
could use some ideas on what could be wrong..

thanks
vm

I had views menu item in my

I had views menu item in my primary menu. This one woked for me (posted here : http://groups.drupal.org/node/13092#comment-179513):

Replace this string:

<?php
 
print menu_tree($menu_name = 'primary-links');
?>

with

<?php
 
print i18nmenu_translated_tree('primary-links');
?>

Make sure i18nmenu module is turned on.

Another approach

If you wish to avoid to replicate the menu structure for each language you can use this add-on module: http://drupal.org/project/i18nmenu_node. It allows a single node menu item to point to different node translations belonging to the same translation set depending on the current language.

Page status

Needs updating

Log in to edit this page

About this page

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here