3

Is there a way to translate a menu link URI?

When I change it in one language (e.g. http://www.example.com), it is also changed in the other language, where I want a different domain (e.g. http://www.example.de).

Link title and description is working as expected.

5 Answers 5

8

It is not possible to translate the menu uri itself. If you want different menu links per language you need to create a unique menu per language, and use block visibility settings to limit each menu block to its respective language.

See this Drupal 8 multilingual hack for a step by step guide: build unique menus per languages

3

I faced a similar requirement. The best solution I found for myself on Drupal 8.5.x was Translatable menu link uri module. You just need to install and follow the steps mentioned in the module description.

2

Change the menu-link URL-alias as per the required language

for e.g.

I wanna products page URL in French => /produits and I wanna products page URL in Netherlands => /producten

than first create a menu and place the menu item in it => main menu - products (menu item) /node/1 (menu link) URL-alias:- go to the URL alias and add the alias for French language => select the language French => IN System path "/node/1" => In Alias path "produits" Like wise for the Netherlands site => select the language Dutch => IN System path "/node/1" => In Alias path "/producten"

and the title of the link are being translatable from menus itself only

Note:- Enable this settings located at Configuration => "Content language and translation" enable the menu custom menu link,content,custom block and tick all the all their check boxes specially URL-alias in content.and don't forget to enable the Drupal 8 multilingual modules.

2
  • Thanks, this might work. But it seems not very handy for the editor to "translate" menu links via URL alias. Different menus per language is currently the way to go. Commented Jul 4, 2017 at 15:04
  • 1
    And this approach does only work for internal links, right? Commented Jul 4, 2017 at 15:08
1

It is not currently possible to have language-specific external links. I created a module that addresses this issue. https://github.com/bbenjamin/Drupal-8---Multilingual-Menu-Links With this module, if users are translating a menu item, they are given the option of adding a language specific external link. If they choose this option, the default Name and Link fields are hidden, and replaced with language-specific fields.

1

A quite small module we used is Menu Multilingual:

The Menu Multilingual module provides multilingual features for menu blocks, to filter out menu items that do not have translated labels or link to untranslated content.

You have to create a menu link for each language and on the configuration for the menu block you should activate both options:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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