Esempio n. 1
0
 /**
  * Get the list of locales that can be downloaded for the current
  * version.
  */
 function getDownloadableLocales()
 {
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     $version =& $versionDao->getCurrentVersion();
     $versionString = $version->getVersionString();
     $descriptorFilename = sprintf(LANGUAGE_PACK_DESCRIPTOR_URL, $versionString);
     return AppLocale::loadLocaleList($descriptorFilename);
 }
 /**
  * Create a cache file with locale data.
  * @param $cache CacheManager
  * @param $id the cache id (not used here, required by the cache manager)
  */
 function _allLocalesCacheMiss(&$cache, $id)
 {
     $allLocales =& Registry::get('allLocales', true, null);
     if ($allLocales === null) {
         // Add a locale load to the debug notes.
         $notes =& Registry::get('system.debug.notes');
         $notes[] = array('debug.notes.localeListLoad', array('localeList' => LOCALE_REGISTRY_FILE));
         // Reload locale registry file
         $allLocales = AppLocale::loadLocaleList(LOCALE_REGISTRY_FILE);
         asort($allLocales);
         $cache->setEntireCache($allLocales);
     }
     return null;
 }