Choosing routing.yml based on user culture?

Posted by Erland Wiencke on Stack Overflow See other posts from Stack Overflow or by Erland Wiencke
Published on 2009-11-02T19:32:46Z Indexed on 2012/04/01 11:30 UTC
Read the original article Hit count: 339

Filed under:
|

In my Symfony application I would like to choose the routing.yml based on the current user's culture;

'en' => routing.en.yml
'no' => routing.no.yml

and so forth.

Any suggestion to how this can be done?

Edit: I am not trying to do i18n this way - I use Symfony's built-in methods for that. I simply want "static" urls to reflect the user's language:

/en/projects/internal/project-name
/no/prosjekter/interne/prosjektnavn
/fr/baguette/champs-elysee/foux-de-fafa

Where "projects" is a module, the category "internal" and "project-name" are stored in the database.

© Stack Overflow or respective owner

Related posts about routing

Related posts about culture