3

I am building a multilingual site with Drupal7 and enabled i18n and menu translation module. I can translate menu items and it is working fine with only one little problem:

If the menu item points to an internal page (i.e: /user) everything is OK, however if the menu item points to a node, the title is translated but I can only specify one path.

I.e.: I have an English page "About us" which is node/1 and have the URL alias /about-us

I have the Hungarian translation of this node "Manunkról" under node/18 and URL alias /magunkrol

I see the correct titles in each language and I get the correct language versions when I click them. BUT on the English page, the link has /about-us in the HREF, but on the Hungarian page it has node/1 (the node path of the English version). The link gets redirected but this is not an ideal solution in regards of SEO. Is there a way to display the URL alias in the HREF for each language?

1

Setting up a menu per language (as stated in other answer) seems to me more like going around the problem rather than fixing it. I created an issue for it at https://drupal.org/node/2051041 and attached a patch.

Using that patch you don't need to the unnecessary hassle of setting up tons of menu items per language just because the href doesn't render as expected.

0

The way to do this is to create 'Fixed Language' menus, one for each language. I wrote a post on this topic. Setting up multilingual menus in D7.

  • Link is broken. Seemed interesting though. – Countzero Dec 1 '14 at 10:37
  • Strange, works for me. Here it is verbose: renaudjoubert.com/en/article/setting-multilingual-menus-d7 – Bisonbleu Dec 2 '14 at 12:11
  • Still page not found here. – Countzero Dec 2 '14 at 16:25
  • 1
    Indeed. Fixed. If for some reason it still doesn't work, try removing the language prefix i.e. 'en/' – Bisonbleu Dec 3 '14 at 2:32
  • Yes, now that's OK. I'll try to correct my negative vote if the site allows me. – Countzero Dec 3 '14 at 8:27
0

Another approach to this is to use Entity Translation, and have a single, language-neutral alias for every node. The URLs are not as nice (same for all languages) but everything else should work well.

It really seems that language-specific aliases should work, but they don't. They result in 404. It seems to me like this is a bug / known limitation of the Entity Translation module.

Aliases default to the current language, so if you go this route, be prepared to have to edit every alias manually to reset it to "All languages", or figure out how to tweak the code to make this automatic.

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.