controllers/FrontController.php
public function locale(Request $request, Response $response, array $data)
    {
        $this->localeManager->setLocale(new Locale($data['locale']));

        return $response->withRedirect($this->container->get('router')->pathFor('index'));
    }
public function locale(Request $request, Response $response, array $data)
    {
        $this->localeManager->setLocale(new Locale($data['locale']));

        return $response->withRedirect($this->container->get('router')->pathFor('index'));
    }
public function locale ( Request $ request , Response $ response , array $ data ) { $ this -> localeManager -> setLocale ( new Locale ( $ data [ 'locale' ] ) ) ; return $ response -> withRedirect ( $ this -> container -> get ( 'router' ) -> pathFor ( 'index' ) ) ; }
Switch locale.

@param Request  $request  PSR-7 request
@param Response $response PSR-7 response
@param array    $data     Query parameters

@return Response
Switch locale .