I have a language selector in my project to redirect to index page with the locale parameter {_locale}, but when the link is to default locale seted in routing.yml, the link looks different. This is my code:
I generate the link in code:
<a href="{{ path('ProjectBaseBundle_index', {'_locale': country.idlang}) }}">
...
</a>
And here is the routing.yml:
ProjectBaseBundle_index:
pattern: /{_locale}
defaults: { _controller: ProjectBaseBundle:Default:index, _locale: es }
requirements:
_locale: en|fr|de|es
This generate propertly the routes for all languages, buy for the default one looks different:
http://project.dev/app_dev.php/en
http://project.dev/app_dev.php/fr
http://project.dev/app_dev.php/de
http://project.dev/app_dev.php/?_locale=es
es is our default language code. I'm using Symfony 2.1
Anyone know How to generate identical route for the default lang?