second level of menu breaks in non default language
| Project: | Localizer |
| Version: | 5.x-3.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi,
I observed the following (I don't know if I do something wrong):
- Have a bilingual site with Localizer.
- In menu options, have the same menu for primary links and for secondary links. Then the secondary menu shows the second level of primary menu.
- I assign one node (page type) to a second level menu item of the primary menu. I create the translations for this node (page).
Then:
- Clic on primary menu item, it shows the second level items in the secondary menu level.
- Then clic on the menu item (in the second level) that links to the mentioned page (the primary link item and the second level menu item remains "active"), everything ok.
But this works fine only with the default language!!, if I turn to another language, the second level menu item remains active, but the primary menu item becomes "no-active", and it's very confusing for the user.
It looks like the code that keeps track of what nodes are under what menu items, lose track when de language is not the default (the url is not the same for the same node in each language, of course, but it looks like the problem come here, I don't know).
I am doing something wrong? some patchs for this? any help?
thanks!
Lluís

#1
Same issue here. I've been pulling my hairs out for a day now over trying to get a consistent solution for multilevel menus in several languages.
I've just played with Drupal 6 and the current dev version of i18n, and even there this doesn't seem to work properly.
What I want is this:
Have a menu tree in the default language (e.g. English). When showing translated nodes, the localizer module should look at the hierarchical position of the corresponding node in the default language, and the menu trail should be based on that.
As it currently is, the menu trail for translated nodes appears to be somewhat unpredictable, with secondary menus sometimes showing up, sometimes not. I still don't understand it enough to fix anything, but I'm a bit frustrated right now.
#2
Menu translation is incredible complex. I spent entire days to have this working.
I improved the code in localizer 3 a lot, but I don't have any time to backport this feature.
#3
Hi Roberto,
I upgraded to Localizer 3.4 to play with this, but the second level menus on my site are still broken. I am using manual language prefixes in my path aliases. Could that be a problem?
Do you need more info to reproduce this?
Best wishes,
Bodo
#4
#5
Let me add to this two things:
1. localizer 3.4 keeps adding language prefixes to my third-level menu links even though language prefixes are turned off
2. The translatable module has perfect support for secondary menus (http://drupal.org/project/translatable). Sadly it has a lot of other problems.
In conclusing, internationalization in d5 remains fairly painful for any non-trivial site that I have tried, so hopefully the contributed modules for d6 are slowly getting ready for production and it will be possible to switch to d6. Meanwhile I'll probably stay with d5 and localizer 1.11, trying to work around the problems mentioned here.
Roberto, I know how painful the drupal menu system is, and I have to thank you for your considerable efforts. Let's hope future versions of drupal will make this easier.
However, if you are still continuing to support localizer on d5, I recommend that you check out the translatable module to see if you could use their approach.
Best wishes,
Bodo
#6
Hi.
translatable module is based on localizer code, version 2.
I checked the code and I am not able to find a cause why the secondary or third level menu shouldn't be translated.
Are these menu items linked to nodes or provided by external modules ?
>even though language prefixes are turned off
This makes me suspect that they are not nodes. Am I wrong ?
In this case, if provided by other modules, you should be able to translate them through
Drupal locale module, if the author has added support for this, of course.
I'll test it again, in any case, as soon as possible for me.
#7
Hi Roberto,
You are right, my menus are not all pointing to nodes.
For this bug, I created a pure menu structure, not linking to nodes, but to dynamic views created by other modules.
With translatable, I create the menu structure in english, and then translate each menu to each target language.
With localizer 3.4, I started to get language prefixes, possibly for the non-node links, even though the prefixing is turned off.
Best wishes,
Bodo
#8
> localizer 3.4 keeps adding language prefixes to my third-level menu links even though language prefixes are turned off
This option has effect only on nodes.
I don't recommend to remove the language prefix. The Drupal cache won't work correctly.
In any case, if you want you can.
Go to : admin/settings/localizer
In the "Language prefix" section, check Show if the following PHP code returns TRUE (PHP-mode, experts only).
and in Pages textarea insert :
<?phpreturn false;
?>
For menu items translation. Go under the menu items and save them again.
#9
I've posted a temporary solution and explanation here :
http://drupal.org/node/225303#comment-1013315