SimpleSAML\Locale\Translate::getDictionary PHP Method

getDictionary() private method

This method retrieves a dictionary with the name given.
private getDictionary ( string $name ) : array
$name string The name of the dictionary, as the filename in the dictionary directory, without the '.php' ending.
return array An associative array with the dictionary.
    private function getDictionary($name)
    {
        assert('is_string($name)');
        if (!array_key_exists($name, $this->dictionaries)) {
            $sepPos = strpos($name, ':');
            if ($sepPos !== false) {
                $module = substr($name, 0, $sepPos);
                $fileName = substr($name, $sepPos + 1);
                $dictDir = \SimpleSAML\Module::getModuleDir($module) . '/dictionaries/';
            } else {
                $dictDir = $this->configuration->getPathValue('dictionarydir', 'dictionaries/');
                $fileName = $name;
            }
            $this->dictionaries[$name] = $this->readDictionaryFile($dictDir . $fileName);
        }
        return $this->dictionaries[$name];
    }