Пример #1
0
/**
 * If the locale data of Yioop! in the work directory is older than the
 * currently running Yioop! then this function is called to at least
 * try to copy the new strings into the old profile.
 */
function upgradeLocales()
{
    if (!PROFILE) {
        return;
    }
    $locale = new LocaleModel();
    $locale->initialize(DEFAULT_LOCALE);
    $force_folders = array();
    /*
        if we're upgrading version2 to 3 we want to make sure stemmer becomes
        tokenizer, version3 to 4 pushes out stopwordsRemover used for
        summarization. version 6 to 7 adds stemmers for french, english, german.
        version 7 to 8 adds stemmers for russian and spanish
    */
    if (!isset($locale->configure['strings']["view_locale_version10"])) {
        $force_folders = array("resources");
    }
    $locale->extractMergeLocales($force_folders);
}