original_string: public function setPjaxRequestLocale(GetResponseEvent $event)
      {
          $request = $event->getRequest();
  
          if (!$event->isMasterRequest() || !$this->requestMatcher->matches($request)) {
              return;
          }
  
          $request->setLocale($request->getPreferredLanguage());
          $request->attributes->set('_locale', $request->getPreferredLanguage());
      }
code: public function setPjaxRequestLocale(GetResponseEvent $event)
      {
          $request = $event->getRequest();
  
          if (!$event->isMasterRequest() || !$this->requestMatcher->matches($request)) {
              return;
          }
  
          $request->setLocale($request->getPreferredLanguage());
          $request->attributes->set('_locale', $request->getPreferredLanguage());
      }
code_tokens: public function setPjaxRequestLocale ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; if ( ! $ event -> isMasterRequest ( ) || ! $ this -> requestMatcher -> matches ( $ request ) ) { return ; } $ request -> setLocale ( $ request -> getPreferredLanguage ( ) ) ; $ request -> attributes -> set ( '_locale' , $ request -> getPreferredLanguage ( ) ) ; }
docstring: On pjax requests, sets the request's locale from the browser's accept-language header.
  @param GetResponseEvent $event
docstring_tokens: On pjax requests sets the request s locale from the browser s accept - language header .