However, in this case, I get a repeating route
There is one route for each language:
$ app/console router:debug about.en ANY ANY ANY /{_locale}/about-us about.lt ANY ANY ANY /{_locale}/apie-mus
When you are on the URL /lt/about-us , UrlMatcher will match the en version:
$ app/console router:match /lt/about-us Route "about.en" matches [router] Route "about.en" Name about.en Path /{_locale}/about-us Path Regex #^/(?P<_locale>[^/]++)/about\-us$#s Host ANY Host Regex Scheme ANY Method ANY Class Symfony\Component\Routing\Route Defaults _controller: AppBundle:Default:index _locale: en Requirements NO CUSTOM Options compiler_class: Symfony\Component\Routing\RouteCompiler
In this case, the local one will be en , not lt .
But I donβt think you should worry about this, because the only way the visitor will see /lt/about-us is to change the URL itself.
source share