1

I've made two yml files, for both routing and menu item:

Route:

tester_helper.products_controller_overview:
  path: '/assortment'
  defaults:
    _controller: '\Drupal\tester_helper\Controller\ProductsController::overview'
    _title: 'Assortment'
  requirements:
    _permission: 'access content'

Menu item:

tester_helper.products_controller_overview_link:
  title: Assortment
  parent: main
  route_name: tester_helper.products_controller_overview
  menu_name: main
  weight: 3

Is it possible to translate both the path and the menu item title?

For example: EN (english): "Assortment" => /assortment

DE (german): "Sortiment" => /sortiment

5

_title in *.routing.yml and title in *.links.menu.yml are translatable by default. Go to user translation (/admin/config/regional/translate) and search there for 'Assortment' and translate it.

The path is not translatable. See this similar question:

Translating paths in routing.yml

In the answer you find some ideas.

  • Thanks for your answer! I'll try my luck translating the paths with aliases. – Paul Sep 21 '16 at 12:43

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.