public function sanitizeLanguage($language)
    {
        if ( 0 === count($this->languages) ) {
            throw new RuntimeException('Polyglot features no supported languages.');
        }

        if ( ! $this->isSupported($language) ) {
            $language = $this->getFallbackLanguage();
        }

        return $language;
    }
public function sanitizeLanguage($language)
    {
        if ( 0 === count($this->languages) ) {
            throw new RuntimeException('Polyglot features no supported languages.');
        }

        if ( ! $this->isSupported($language) ) {
            $language = $this->getFallbackLanguage();
        }

        return $language;
    }
public function sanitizeLanguage ( $ language ) { if ( 0 === count ( $ this -> languages ) ) { throw new RuntimeException ( 'Polyglot features no supported languages.' ) ; } if ( ! $ this -> isSupported ( $ language ) ) { $ language = $ this -> getFallbackLanguage ( ) ; } return $ language ; }
Retrieve the fallback language if the variable isn't a supported language.

@param string $anguage

@return string

@throws RuntimeException if there are no available languages
Retrieve the fallback language if the variable isn t a supported language .