public function getLanguage()
    {
        if ($this->language)
            return $this->language;
        if ($this->defaultLanguage)
            return $this->defaultLanguage;
        $prefered = $this->getPreferredLanguage();
        if (in_array($prefered, $this->availableLanguages))
            return $prefered;
        return $this->availableLanguages[0]; // if nothing works return first language from the list
    }
public function getLanguage()
    {
        if ($this->language)
            return $this->language;
        if ($this->defaultLanguage)
            return $this->defaultLanguage;
        $prefered = $this->getPreferredLanguage();
        if (in_array($prefered, $this->availableLanguages))
            return $prefered;
        return $this->availableLanguages[0]; // if nothing works return first language from the list
    }
public function getLanguage ( ) { if ( $ this -> language ) return $ this -> language ; if ( $ this -> defaultLanguage ) return $ this -> defaultLanguage ; $ prefered = $ this -> getPreferredLanguage ( ) ; if ( in_array ( $ prefered , $ this -> availableLanguages ) ) return $ prefered ; return $ this -> availableLanguages [ 0 ] ; // if nothing works return first language from the list }
Get current language
@return bool|string
Get current language