Hi! Both Corporate Clean and Blue Masters do not have support for multilingual main menu.
If a site has i18n and menu translation modules installed and there are translation pairs for each menu item normally you'd want only items of the currently selected language to appear on the menu — right now my favorite theme shows all of them at once (which is not the case for Bartik and Seven).
I tried to replace the code in page.tpl.php and it worked but the menu looked ugly and I don't know how to fix it.
It would be great if I manage to make it look exactly like original but since I'm not very much of a hacker I'd appreciate if someone could also take a look into it.
Oleg
Comments
Comment #1
Oleg CreditAttribution: Oleg commentedLooks like it is a common problem for custom themes in D7.
See http://drupal.org/node/1021462
Comment #2
tugis CreditAttribution: tugis commentedI got the same problem and found the solution.
The menu is not localized because in "page.tpl.php" template, the function "menu_tree" is being used to build the menu instead of "i18n_menu_translated_tree" (assuming you are using i18n module for translations).
In the "page.tpl.php" of your theme you should have:
Comment #3
Oleg CreditAttribution: Oleg commentedtugis, that's really great!
thanks for sharing and Happy New Year!
Comment #4
dimitriseng CreditAttribution: dimitriseng commentedHi, the suggestion in #2 works and it would be great if it could be great if it could be added, although I guess that a check should be made first to check whether i18n is installed. Thanks!
Comment #5
gtsopour CreditAttribution: gtsopour commentedThank you everyone
I will checkout directly your proposals and i will commit them
Thanks
/George
Comment #6
su_root CreditAttribution: su_root commentedHi all,
I can confirm that #2 is also working!
Sorry for the off topic but has anyone found a nice an clean way of implementing the language switcher on the theme?
BR,
Su_root
EDIT: I don't even know where to start editing the layout of the language switcher so a point in the right direction is appreciated.
Comment #7
chlee CreditAttribution: chlee commentedHi all,
I also confirm that #2 is working fine.
Just what I was looking for.
Best Regards,
Chris
Comment #8
gtsopour CreditAttribution: gtsopour commentedHello,
Thank you sincerely for your help and for your comments in this issue.
Could you please review the following code once again before committing it?
Thanks
/George
Comment #9
Oleg CreditAttribution: Oleg commentedThank you, I can confirm that this code works for both of my 2 sites one of which has no i18n module. The other one now shows menu items from one language only - just what I was looking for.
Thank you all for your help.
Comment #10
szt CreditAttribution: szt commented#8 works! Thanks!
Comment #11
gtsopour CreditAttribution: gtsopour commentedCommitted and will be included into next Corporate Clean release 7.x-1.4
Thanks
/George
Comment #12
SebCorbin CreditAttribution: SebCorbin commentedCall to undefined i18n_menu_translated_tree
I don't have i18n_menu enabled, causing this error, you need to change the condition from i18n to i18n_menu in http://drupalcode.org/project/corporateclean.git/blobdiff/8bc183cf3ed834...
if (module_exists('i18n_menu')) {
Comment #13
gtsopour CreditAttribution: gtsopour commentedHello SebCorbin
Thank you sincerely for your help and for your report in this issue.
I will change this code with your suggestion and come back with the final code before commiting for testing.
Thanks
/George
Comment #14
cheiwe CreditAttribution: cheiwe commentedNot work for my site! Please help! version 1.4 i18n was updated.
Fatal error: Call to undefined function i18n_menu_translated_tree() in /home/virtwww/w_raresoft_913db49d/http/sites/all/themes/corporateclean/page.tpl.php on line 39
Comment #15
Oleg CreditAttribution: Oleg commented@su_root have you tried https://drupal.org/project/lang_dropdown ?
Comment #16
gtsopour CreditAttribution: gtsopour commentedHello cheiwe,
as SebCorbin said, please try the following code.
Thanks
/George
Comment #17
gtsopour CreditAttribution: gtsopour commentedHello,
Just committed the code from comment #16
Τhank you all sincerely for your comments
/George