public function load($langs) {
        // List file names
        $files = $this->listLangFiles();
        $this->loadedLang = null;

        if (empty($files)) {
            throw new CantLoadDictionaryException(CantLoadDictionaryException::NO_DICTIONARY_FILES);
        }

        foreach ($langs as $lang) {
            $loaded = $this->loadMatchingFile($files, $lang);
            $dict = $loaded['dict'];
            $loadedLang = $loaded['lang'];
            if ($dict !== null) {
                $this->loadedLang = $loadedLang;
                return $dict;
            }
        }

        return null;
    }
public function load($langs) {
        // List file names
        $files = $this->listLangFiles();
        $this->loadedLang = null;

        if (empty($files)) {
            throw new CantLoadDictionaryException(CantLoadDictionaryException::NO_DICTIONARY_FILES);
        }

        foreach ($langs as $lang) {
            $loaded = $this->loadMatchingFile($files, $lang);
            $dict = $loaded['dict'];
            $loadedLang = $loaded['lang'];
            if ($dict !== null) {
                $this->loadedLang = $loadedLang;
                return $dict;
            }
        }

        return null;
    }
public function load ( $ langs ) { // List file names $ files = $ this -> listLangFiles ( ) ; $ this -> loadedLang = null ; if ( empty ( $ files ) ) { throw new CantLoadDictionaryException ( CantLoadDictionaryException :: NO_DICTIONARY_FILES ) ; } foreach ( $ langs as $ lang ) { $ loaded = $ this -> loadMatchingFile ( $ files , $ lang ) ; $ dict = $ loaded [ 'dict' ] ; $ loadedLang = $ loaded [ 'lang' ] ; if ( $ dict !== null ) { $ this -> loadedLang = $ loadedLang ; return $ dict ; } } return null ; }
Load the best dictionary looking at the prefered languages given in parameter.

@param array $langs Ordered list of accepted languages, prefered ones are first
@return array|null The dictionary or null if not found
@throws CantLoadDictionaryException Thrown when there is no files in the directories path
Load the best dictionary looking at the prefered languages given in parameter .