use Symfony\Component\HttpFoundation\Request; public function myController(Request $request) { $locale = $request->getLocale(); // get current locale $request->setLocale('fr_FR'); // set locale to French // do something with the locale }In this example, we first get the current locale of the request using the getLocale() method. We then set the locale to French using setLocale(). The new locale will be used for any subsequent Symfony components or services that rely on the request's locale. As for the package library, it is part of the Symfony framework and is included by default in any Symfony application.