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();

 

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.

Leave a Comment

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