public function getUserLanguage(ServerRequestInterface $request = null)
    {
        if (
            $this->saveInSession &&
            isset($_SESSION['language']) &&
            $this->isSupported($_SESSION['language'])
        ) {
            return $_SESSION['language'];
        }

        if ( empty($language) && $request instanceof ServerRequestInterface ) {
            return $this->getFromHeader($request);
        }

        return null;
    }