The "link" field for menu items is not translatable - this is fine for internal links since Drupal knows which version to reference automatically.

This can be a problem for external links, as there might be a need to provide a different URL based on the link language.

This module creates a "Provide Translated External Link" option in the menu link form for translated items.

When enabled, it replaces the Link and Title fields with versions that are language specific.

The current recommendation is to create language specific menus. This module eliminates the need for that.

Currently, the revised links get added in a preprocess hook.

Requirements

No special requirements. Requires menu_link_content from Drupal core.

Install

Install module via composer or via standard Drupal module install practices.

composer require drupal/multilingual_menu_urls

Enable via Drush:

drush en multilingual_menu_urls

Usage

  • Install and enable module.
  • Make Custom menu link translatable (admin/config/regional/content-language).
  • Exclude "Provide Translated External Link" & "Translated Link" from being translated.
  • Add menu link to a menu for default language and set external link.
  • Translate menu link for another language and you should see "Provide Translated External Link" checkbox.
  • Check the box and provide the translated information as needed.
  • Save menu item.
  • Test out menu links in the translated languages.
Supporting organizations: 

Project information

Releases