Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Menu links associated to a node with a language were hidden if they were different from the current user language.
Now my main menu display all the menu links whatever the node language is.
Is this the wanted behavior by the developers?
If yes, is there a workaround to display only current user language menu links?
Comments
Comment #1
webmaster-eddie CreditAttribution: webmaster-eddie commentedI have this problem too, and I think I also had it with the upgrade for i18n to 7.x-1.5, too!
Perhaps it is resetting the translation sets data, or requiring translation sets to be completed, even though one sets the langugage of the content node.
Subscribe.
Comment #2
zarabatana CreditAttribution: zarabatana commentedSame problem.
Subscribe.
Comment #3
drupalok CreditAttribution: drupalok commentedsame problem... i finally switched to one menu block per language as a workaround
Comment #4
rondev CreditAttribution: rondev commentedThank you for the tip.
For now I didn't find a solution for for the main menu in the Bartik theme. I can't find a way to create different language blocks for the main menu.
Comment #5
zarabatana CreditAttribution: zarabatana commentedwell i'll try to revert the update...for now
Comment #6
Grammer CreditAttribution: Grammer commentedBack 7.x-1.6 to
i18n-7.x-1.x-dev, 2012-05-23
which works well.
Comment #7
rondev CreditAttribution: rondev commentedI found a possible related issue #1594804: Menu language Undefined when it inherits language from node. I will have a look.
Edit: the patch #1594804-3: Menu language Undefined when it inherits language from node solves the language set to undefined but all the menu links are still displayed.
Comment #8
webmestre CreditAttribution: webmestre commentedSame problem
Comment #9
wqmeng CreditAttribution: wqmeng commentedSame problem
Comment #10
Spruitje CreditAttribution: Spruitje commentedSame problem.
But simply cannot believe this issue affects this few people?!
Menu's built with Menu Block Module are working fine, it only affects Drupal Menu's.
Subscribe.
Comment #11
Spruitje CreditAttribution: Spruitje commentedFound the solution which turned out to be quite simple...
I edited the menu and set the following Multilingual option: (it was set to 'no multilingual options' out of the blue!)
==> Translate and Localize. Menu items with language will allow translations. Menu items without language will be localized.
Comment #12
jschrab CreditAttribution: jschrab commented@Spruitje: Actually, that's not what I have found - Menu Block module generated menus show all language links in a book instead of filtering down to "current language".
Comment #13
Jose Reyero CreditAttribution: Jose Reyero commentedPlease read the release notes.
Language selection is not using node access anymore for menu items.
Comment #14
rondev CreditAttribution: rondev commentedI tried to read the release note before posting my issue but as I don't understand the tenth of it I didn't spent more time on it. With my level, I don't see any reference to your sentence in it nor my specific issue. I don't understand what concept "Language selection" is nor "node access" means exactly.
Then my question, is it possible now with i18n to have translated menu items in the main menu for a Bartik theme? Does someone manage to do it?
If it not possible nor a wanted feature, we can close the discussion.
Comment #15
mesr01 CreditAttribution: mesr01 commentedI read the release notes. It is indeed said that there is a change in language selection but I did not find any clue about an upgrade path for making menus built with v7.x-1.5 work with 1.6. What is the recommended fix? Should I now create separate menus for language selection, or is there a new way to filter menu items based on current language? Thanks.
Comment #16
damtoul CreditAttribution: damtoul commentedHello,
I got the same problem but I found a workaround for newbies programmers like me. Everything could be corrected in the GUI.
----
Go to Configuration/Multilingual settings then to Variables tab. In menu settings, check select source for main and secondary links.
Go to Menus and add a menu for each languages you have (English Menu, French Menu, etc...).
In Menus go to Settings tab. You can now at the top of the window choose the language, and then choose the right main menu associated to this language.
* This choice won't appear if the variables are not previously selected. *
Ex : English=>English menu for the source for the main links.
----
I hope I'm clear in my explanations.
Kind regards,
Damien.
Comment #17
rondev CreditAttribution: rondev commentedYes clear, thank you.
It solved my issue. I set a "fixed language" for each menu but we can let them as "No multilingual options" as language is defined later in variables.
I just noticed a strange behavior. After the menu association for each language, I had to edit each menus again and save them to the site displays them.
I will now update my production site.
Comment #18
mesr01 CreditAttribution: mesr01 commentedI'm reopening this request since a simple "Please read the release notes." is not exactly what I would call "support" (unless there is clear answers in the release notes, which I still cannot find to this day). I simply cannot understand how a module as important as i18n can let users down like this with so few explanation and without an official upgrade path. Having to create new menus with fixed language for every menus in every sites I ever built with Drupal 7 is, to say the least, a real show stopper. I don't believe that this is actually a scalable solution.
Besides, can somebody explains why, out of a sudden, menu visibility cannot be handled automatically any more when menu items still carry a language tag? Why give the option to "Translate and localize" in the first place if this has no effect on visibility?
Comment #19
Jose Reyero CreditAttribution: Jose Reyero commented@mesr01,
Feel free to reopen, complain, whatever.... just fyi I won't be following this issue anymore. I love this 'Unfollow' button.
And by the way, the solution to your problem is here: how to get real and serious support for your Drupal issues"
Have a nice day.
Comment #20
rondev CreditAttribution: rondev commentedI didn't notice it the first time I check my site but I had the same issue in menu display though a Panel.
What I done to make the site working well again:
- create a menu per language.
- add the menus of each language in the panel.
- control the visibility of each with visibility rules of user language.
I didn't find a better solution. Could be some work for a many languages site.
Comment #21
mesr01 CreditAttribution: mesr01 commented@Jose ReyeroHey: Hey, just asking for some simple and complete information here since the release notes are very shallow on the topic. Never asked to debug my code. Please provide basic information to the community, for the same reason I/we contribute patches and new features:
I understand that a lot of people solved the issue by creating new menus with fixed language, but this is not a very practicable solution for when have dozens of sites to upgrade.
Comment #22
Aeolun CreditAttribution: Aeolun commented@mesr01: +1
This is a problem that needs to be addressed. How can you go change out core functionality without a decent way to convert from the previous situation?
The functionality of your website will potentially breaks if you do this upgrade, and that is something that (in my humble opinion) should never happen.
@Jose: Saying you will not follow this issue anymore because you (for some reason) dislike what is written (without providing a solution) doesn't exactly give me a good impression of drupal developers.
Thank you.
Comment #23
wqmeng CreditAttribution: wqmeng commentedFor anybody that use Superfish module you will need this patch to get superfish to display the correct menu after you have changed to translate menus to be fixed language from #16.
#1689228: Get superfish to show the correct menu since the i18n_menu module now only use variable translate.
Comment #24
webmaster-eddie CreditAttribution: webmaster-eddie commentedRequest for clarification as to how i18n is suppossed to be used for multilingual D7 sites with a "Main Menu" that is Primary Links, in which each menu item must be translated (and, of course, only the menu tabs (items) in the page's correct language will display). Would someone who really understands this new way of building multilingual menus please answer the following question:
Is the new correct way to use i18n the following:
1) In /admin/structure/menu use the existing "Main Menu" for one language's (let's say English for this example) main menu principal links tabs or menu items only, and set it up as a "Fixed Language. Menu items will have a global language and they will only show up for pages in that language." menu, and only add menu items or links in English
2) To add a French main menu for primary links, in /admin/structure/menu Add a new menu, call it, for example "Menu Principal", and set that as a "Fixed Language. Menu items will have a global language and they will only show up for pages in that language." menu, and only add menu items or links in French
3) repeat for each additional language.
Thus there will be no Translation sets which equate the English "Home" menu item with the French "Accueil" menu item. Is that right, and there will be no way that the D7 system understands that the French "Menu Principal" corresponds to the English language "Main Menu"?
I just want confirmation that this is the new suggested and recommended approach to building multilingual sites with i18n, please.
Please let me know, kindly, if this is not the new recommended way to do this. I seem to have a problem understanding some of the wording and language surrounding this issue.
Thank you very much.
Comment #25
webmaster-eddie CreditAttribution: webmaster-eddie commentedPosted by Jose Reyero on July 19, 2012 at 10:37am
Download http://drupal.org/project/i18n_contrib
And enable the module 'Multilingual select menu filter'.
The above worked for me on the display of main menu primary links using marinelli. The module is only to provide backwards compatibility. Would love to know the best practice suggested way to create multilingual main menu and navigation primary and secondary menu links, as I am going to test this now.
Comment #26
mesr01 CreditAttribution: mesr01 commentedThanks @webmaster-eddie for the information.
I wonder why we're just left in the blue. A couple of simple sentences with the right information would probably be enough to solve this whole issue about a pretty important change in the module. I just don't understand why the maintainer(s) aren't giving explicit guidelines on this.
Comment #27
bachbach CreditAttribution: bachbach commentedsympa l'ambiance …
i'm disappointed by this attitude to !
Comment #28
hles CreditAttribution: hles commentedGuys, go to admin/structure/menu, "edit" a menu and you will find the multilingual options for menus if the respective i18n sub-module is enabled. Decide which setting is better according to your preference.
Comment #29
Frederic wbase CreditAttribution: Frederic wbase commentedThanks to webmaster-eddie!
Comment #30
Gabo11 CreditAttribution: Gabo11 commentedThanks a lot webmaster-eddie!!!
Problem solved!
But i really have to say that i find the i18n upgrade a bit improper in relation to menu links associated to a node!
Comment #31
kamenrs CreditAttribution: kamenrs commentedThanks to webmaster-eddie for helping us cope with this problem.
I feel very, very disappointed by the attitude of the module maintainer. I think that such a behavior is what really ruins the foundations of the Drupal community and repels people from Drupal. As far as I know, lots of effort are put in making Drupal easy to use, user friendly and attractive, but this kind of "support" for such an important and no-alternative module, can make every average user to reject Drupal.
Shame ...
Comment #32
mediameriquat CreditAttribution: mediameriquat commented#11 solved it for me. Thank you Spruitje, it was quite simple indeed.
Btw I have only one "Main menu" for all the installed languages (no translation sets), and my menu items were created through the node edit form.
Comment #34
Jose Reyero CreditAttribution: Jose Reyero commentedNext release (7.x-1.8) should fix all these menu issues, see #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
Please test it why it's still in dev...
Comment #35
kenorb CreditAttribution: kenorb commentedTested 1.8, #11 and #34 patch, but it still doesn't work.
I'm Main Menu with nodes which has mixed languages, and these with different language are not hidden.
As workaround, the following module worked:
http://drupal.org/project/i18n_contrib
(Multilingual select menu filter)
Comment #36
mvcnote: possibly related to #1642344: i18n_menu 6.x -> 7.x upgrade path
Comment #37
Mod74 CreditAttribution: Mod74 commentedYeah, this still doesn't work in 1.8
Comment #38
VVVi CreditAttribution: VVVi commentedAfter update from 1.5 to 1.13 this stopped working. For fix is needed:
Comment #39
NSp CreditAttribution: NSp commentedDrupal 7.53, i18n 1.15 — facing with same issue: just enabled internationalization for local language website, translated everything except nodes to English, then I've changed menu setting to "Translate and Localize. Menu items with language will allow translations. Menu items without language will be localized." and then I see this behavior:
- All menu items shown for both Local and English languages
- In menu I can see Undefined language inherited from Local language nodes
- If I save Local node manually unchanged, then it disappear from the menu and menu item language become Local
- If I save Local node using VBO or just change language in the "menu_links" table in database — nothing happened (in second case menu item language become Local, but menu item still shown for both languages)
- If I create translated English node for the Local node and then add it to the menu, it has shown only for English language
How can I resave many nodes if it didn't work with VBO (node_save($entity))?