Drupal - Translating paths in routing.yml

As far as I know (anyone, correct me if I'm wrong!) this is not possible in the routing system. You can however add a path alias, and make "/ruta-de-acceso/a/contenido" an alias in the Spanish language for '/path/to/content'.

Now the problem with path aliases, compared to routes, it that they are considered content, not core or configuration. As a result there is (again: AFAIK) currently no way to export them and deploy them to a server. For a recent project, I solved that with some custom code in the .install file of a custom module. You can see the code in this Github gist: Drupal 8: Custom path aliases exported to code.

Tags:

8

I18N L10N