Symfony2 URL translate and structure for multilanguage site Symfony2 URL translate and structure for multilanguage site symfony symfony

Symfony2 URL translate and structure for multilanguage site


For use multilanguage in site, you can set locale to router:

about_me:  pattern: /{_locale}/about-me  defaults: { .... }  requirements: { _locale: en|it }

And control locale in controller:

$this->get('request')->getLocale();


For this case, you should look at the JMSI18nRoutingBundle. With it you can localize your routes (e.g. the 'about-me' part in you example), not only the sites.