PHP Symfony: Access the internationalization “locale”

In your controller, you can access the special global “_locale” variable from the Request object:

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

$locale= $request->getLocale();

 

Leave a Reply 0

Your email address will not be published. Required fields are marked *