protected function getFromHeader(ServerRequestInterface $request)
    {
        $accept = $request->getHeaderLine('Accept-Language');

        if ( empty($accept) || empty($this->languages) ) {
            return;
        }

        $language = (new Negotiator())->getBest($accept, $this->languages);

        if ( $language ) {
            return $language->getValue();
        }
    }