0

I use Drupal 7, locale and the i18n modules. I've setup a mini site with node translation.

I have the following EN nodes:

  • node/1 About
  • node/2 Terms
  • node/3 FAQ
  • node/4 Contact

and the following FR nodes:

  • node/5 A propos [translation of node/1]
  • node/6 Contacter [translation of node/4]

The main site is the English one and the French menu will always be equal or a subset of the English one (same structure).

I've implemented the site using 2 menus, one for EN (4 links + Home) and one for FR (2 links + Home). This works but doesn't scale well if I have many (500) nodes per language and:

  • I decide to add a new language
  • I decide to reorder some nodes around (change parents etc)

I've also implemented the site using 1 menu (the "Main Menu") and it contains all links (4 links + 2 links + Home). This works but still has the previous disadvantages and in addition:

  • links are mixed when the user is selecting parent menus

So, my question is, assuming I need a 1-to-1 mapping from EN to FR, or a subset of EN but with the exact same structure, isn't there a simpler way to solve this? Ideally I'd want to have a single Menu which would specify something like:

  • /about -> node/1, /fr/about -> node/5
  • /terms -> node/2
  • /faq -> node/3
  • /contact -> node/2, /fr/contact -> node/6

Is this possible?

  • Why not rely on the Menu Translation module packed with i18n ? Given your use case, it seems to fit your needs better. You'd always have the same menu, and with language fallback you'd only have to translate the relevant entries, living the others in the original language. – Countzero Apr 24 '12 at 14:24
  • Translating menu items has no effect whatsoever. The translated menu items never appear on the FR menu. I'm following hojtsy.hu/blog/2011-nov-19/… to the letter but no luck. – cherouvim Apr 24 '12 at 14:56
  • Have you enabled interface (vs content) translation ? As per this post, menus are related to interface, not content. – Countzero Apr 24 '12 at 15:46
  • @Countzero if I have a menu item pointing to node/1, yes I can translate it to FR, but it'll still be pointing to node/1 and not node/5. So I've found that menu item translation works well when it points to a view or to an external URL but not to a node. Do you confirm? – cherouvim Aug 10 '12 at 10:08
  • Yes, it's easier when the item points to a page which handles its own translations. Anyway, whatever the translation system you should end with a different menu item for each translation if I remember correctly. Things change fast in the translation stuff, so be sure to keep your modules up to date, especially with entities related stuff. – Countzero Aug 13 '12 at 6:29
0

No it's not possible because each menu link can point to a specific (one) node. When using node translation the different translations of a node are other nodes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.