public function onRequest(Application $application, Request $request)
    {
        $params = $request->getParameters();
        $this->setCode($params['locale'] ?? $this->defaultLocale);
    }
public function onRequest(Application $application, Request $request)
    {
        $params = $request->getParameters();
        $this->setCode($params['locale'] ?? $this->defaultLocale);
    }
public function onRequest ( Application $ application , Request $ request ) { $ params = $ request -> getParameters ( ) ; $ this -> setCode ( $ params [ 'locale' ] ?? $ this -> defaultLocale ) ; }
On request.

@param Application $application
@param Request     $request
On request .