PKPLocale::installLocale PHP Method

installLocale() static public method

Install support for a new locale.
static public installLocale ( $locale )
$locale string
    static function installLocale($locale)
    {
        // Install default locale-specific data
        import('lib.pkp.classes.db.DBDataXMLParser');
        $emailTemplateDao = DAORegistry::getDAO('EmailTemplateDAO');
        $emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale));
        // Load all plugins so they can add locale data if needed
        $categories = PluginRegistry::getCategories();
        foreach ($categories as $category) {
            PluginRegistry::loadCategory($category);
        }
        HookRegistry::call('PKPLocale::installLocale', array(&$locale));
    }

Usage Example

Esempio n. 1
0
 /**
  * Install support for an existing locale.
  * @param $locale string
  */
 function installLocale($locale)
 {
     parent::installLocale($locale);
     $genreDao =& DAORegistry::getDAO('GenreDAO');
     /* @var $genreDao GenreDAO */
     $genreDao->installLocale($locale);
     $publicationFormatDao =& DAORegistry::getDAO('PublicationFormatDAO');
     /* @var $publicationFormatDao PublicationFormatDAO */
     $publicationFormatDao->installLocale($locale);
     $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
     /* @var $userGroupDao UserGroupDAO */
     $userGroupDao->installLocale($locale);
 }
All Usage Examples Of PKPLocale::installLocale