Translating paths in routing.yml How do you translate the path portion of a module route?

For instance you have:

module_name.my_route_name:
  path: '/path/to/content'
  defaults:
    _controller: \Drupal\module_name\Controller\MyController


How do I get /es/ruta-de-acceso/a/contenido to point to the same route name?
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.