Le 31/05/2011 13:14, Mauricio Morales a écrit :
Hi there community :)

I'm trying to build a URL routing scheme for a web application that
will be offered in different languages. It's a Symfony2 app and I've
been wondering what the best way to address this situation is.

What we need is as simple as this, i.e.:

example.com/es/services
example.com/en/services

example.com/en/terms-of-use
example.com/es/terms-of-use


Notice that we don't need I18N, we always keep the same URL routes and
parameters, and the only part that will change is the prefix (first
part of URL). What we are looking for is for a very transparent way to
build the URLs and keep the locale in them, a very easy-to-use
solution, we don't want to care about the locale in URL generation in
templates or controllers.

Have you addressed a situation like that?, do you have any ideas,
thoughts?


Thanks a lot,
Use a /_locale/ placeholder in the routes. This will set the locale automatically when matching the route and the locale will be injected when generating an url.

--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to