Active
Project:
OM Maximenu
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2012 at 16:36 UTC
Updated:
30 Apr 2013 at 06:53 UTC
Hi and thanks for this great module.
Can anyone clarify my options with regarding to making OM_maximenu a fully multilingual menu?
In my existing setup I have menu blocks in the maximenu that translate nicely when language is switched. Unfortunately the menulinks (that define the always-visible tab-like links along the top of the menu) don't appear to have any options for translation.
I have i18n installed but don't see anything there (strings?) that can be translated either.
I guess I could manually (and laboriously) create new Maximenus for each language and use PHP for block visibility to only show the correct one, but would prefer a cleaner and more scaleable/easier to maintain solution.
Comments
Comment #1
jonodunnett commentedTo do this I used PHP in the titles to get these to translate, e.g:
I have a problem now with getting the backLava / active trail effect to be active when I visit the pages which are translations... This works for the default language but not the translated languages. Any ideas how I might be able to get this to work?
Comment #2
jorisx commentedtranslation of the drop down content works but the main links... should i create different blocks with Om Maximenu for every language?
Comment #3
Kohnock commentedI solved it by adding the t() function to the menu item title:
file: om_maximenu.utils.inc
line 56
-$link_title = stripslashes($content['link_title']);
+$link_title = stripslashes(t($content['link_title']));
You have to define the menu item text in english and have a translation of that text to the other languages.
Comment #4
jorisx commentedThanks that works good!
The only thing is the urls; they need to have the same name and can't be translated
so for my products page it is still called /nl/producten and /en/producten instead of /en/products
any ideas?
Comment #5
facal commentedThank you Kohnock . It is simple and works great, should be committed in next release in my opinion.
Comment #6
danielhonrade commentedcommitted on dev
Comment #7
rv0 commentedadding t() to the menu item title is a failed approach
t() should never be used on user submitted texts.
http://groups.drupal.org/node/149984
I guess i18n_string is the way to go?
Comment #8
Diane Bryan commentedI don't think this handles menus with image-replacement. An example of this would be a single-item where the Om Maximenu contains the entire menu as a dropdown, and the word "MENU" is replaced with an image. The URL to that image will be prepended with (t), pointing to a URL that doesn't exist.