I have a few dozen routes defined as follows:
services:
path:
en: /en/services
de: /de/dienstleistungen
controller: App\Controller\SimplePageController::page
This is using the Localized routing which I believe was introduced in Symfony 4.1.
The routes all have paths for both English and German. Now I want to translate a few specific pages in some other languages. For instance my homepage. The problem is that if I add another language to the route of my homepage, it will not load since it can't create links to other pages that do not have a route defined in this new language.
If I visit /nl/homepage, the following link generation in Twig fails
<link href="{{ path('services') }}">
with the error
Unable to generate a URL for the named route "services" as such route does not exist.
How can I tell Symfony to create links to the English routes if the current language does not have a route for it? Or even better, specify some dynamic path along the lines of:
services:
path:
en: /en/services
de: /de/dienstleistungen
default: /$1/services
controller: App\Controller\SimplePageController::page
Edit: I am now using Symfony 5.0.4 and still have the same problem.