Is it possible to have different languages in Symfony2 ( but also default to for English?

I'm trying to find a way to setup Symfony2 with language support but where it defaults to a default language if a language not entered.

So basically I want to allow these URLs for the 'page' page:


I can easily do it if you always specify a language (e.g. but I don't want that. I want my links to be like this for English:

...and IF the user changes language to then append that to the URL:

I currently use this but I have to specify a language on every request:

    resource: "@MyBundle/Resources/config/routing.yml"
    prefix:   /{_locale}
     _locale: en|fr|es|de

I don't think this is possible??


You should use JMSI18nRoutingBundle. Scenario #2 (described in the docs) is what you want.

Need Your Help

Compare Values From 2 While Loops (PHP MYSQL)

php mysql sql

I'm trying to create all time standings for head to head matchups in a fantasy football league. I'm using two separate queries and grabbing the data with two separate while loops. I was hoping I co...

How to send associated data to server side in ext js4?

extjs proxy extjs4

I am new in extjs4 .I am using MVC structure.and I am going to save associated data to server side.I am getting stuck at this point.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.