Closed martijnhartlief closed 8 years ago
Symfony does not support locale requirements (unless the _locale
placeholder exists in the URL)
Even if I add the _locale in the url, it will fail after trying to matching the first route. I guess it's not possible what i want.
Why do you need this bundle if you enumerate all routes on the controller?
To clean up the locales from the routing.
Not all routes work have to be like this, but for SEO reasons the customer wants to prefix / suffix certain keywords based on locale. I was hoping this bundle would return the correct route based on the supplied/active locale.
But as @stof mentioned, it has probably more to do with how Symfony handles requirements than an actual defect of this bundle :)
I also found out you can't mix prefix locale and domain based locale selection, so I'll have to write something custom anyway.
With the following Route annotation:
If i generate the url with {{ path('app_controller_action', {'name': 'test', '_locale': 'nl'}) }} It generates this url: /nl/test-example when I would expect it to generate /nl/test-voorbeeld
Also the route works with the wrong suffix when I would expect it to return a 404 exception.
When I reverse the Route annotation order it generates it correctly, but It doesn't work for 'en'. So I have the feeling it completely ignores the requirements.
How can I force this behaviour?