PKPLocale::registerLocaleFile PHP Method

registerLocaleFile() static public method

Register a locale file against the current list.
static public registerLocaleFile ( $locale, $filename, $addToTop = false )
$locale string Locale key
$filename string Filename to new locale XML file
$addToTop boolean Whether to add to the top of the list (true) or the bottom (false). Allows overriding.
    static function registerLocaleFile($locale, $filename, $addToTop = false)
    {
        $localeFiles =& AppLocale::getLocaleFiles($locale);
        $localeFile = new LocaleFile($locale, $filename);
        if (!HookRegistry::call('PKPLocale::registerLocaleFile::isValidLocaleFile', array(&$localeFile))) {
            if (!$localeFile->isValid()) {
                return null;
            }
        }
        if ($addToTop) {
            // Work-around: unshift by reference.
            array_unshift($localeFiles, '');
            $localeFiles[0] =& $localeFile;
        } else {
            $localeFiles[] =& $localeFile;
        }
        HookRegistry::call('PKPLocale::registerLocaleFile', array(&$locale, &$filename, &$addToTop));
        return $localeFile;
    }