public function getAcceptableLanguages()
    {
        if ($this->_languages === null) {
            if ($this->getHeaders()->has('Accept-Language')) {
                /** @var string $acceptLangHeader */
                $acceptLangHeader = $this->getHeaders()->get('Accept-Language');
                $this->_languages = array_keys($this->parseAcceptHeader($acceptLangHeader));
            } else {
                $this->_languages = [];
            }
        }

        return $this->_languages;
    }
public function getAcceptableLanguages()
    {
        if ($this->_languages === null) {
            if ($this->getHeaders()->has('Accept-Language')) {
                /** @var string $acceptLangHeader */
                $acceptLangHeader = $this->getHeaders()->get('Accept-Language');
                $this->_languages = array_keys($this->parseAcceptHeader($acceptLangHeader));
            } else {
                $this->_languages = [];
            }
        }

        return $this->_languages;
    }
public function getAcceptableLanguages ( ) { if ( $ this -> _languages === null ) { if ( $ this -> getHeaders ( ) -> has ( 'Accept-Language' ) ) { /** @var string $acceptLangHeader */ $ acceptLangHeader = $ this -> getHeaders ( ) -> get ( 'Accept-Language' ) ; $ this -> _languages = array_keys ( $ this -> parseAcceptHeader ( $ acceptLangHeader ) ) ; } else { $ this -> _languages = [ ] ; } } return $ this -> _languages ; }
Returns the languages acceptable by the end user.
This is determined by the `Accept-Language` HTTP header.
@return array the languages ordered by the preference level. The first element
represents the most preferred language.
Returns the languages acceptable by the end user . This is determined by the Accept - Language HTTP header .