in my Symfony 3.3 project I use locale system to change the user language. I have configured my routing to allow the 'en' version for not having it in the url.
acme_front_office:
resource: "@AcmeFrontOfficeBundle/Resources/config/routing.yml"
prefix: /{_locale}
defaults: { _locale: 'en'}
requirements:
_locale: '|en|fr'
So those url redirect all to the same page :
/home
/en/home
/fr/home
But in my twig templates the {{ path() }} function set by default the right locale except that when my user see the english version of the website I want that the generated url head to /home and not /en/home.
If you have a clue on how to do that without changing all the path() calls to override the _locale param I will be very thankful.
Have a good day ;)