/** * Retrieves locale data from the locales cache. * @return array */ function &_getAllLocalesCacheContent() { static $contents = false; if ($contents === false) { $allLocalesCache =& AppLocale::_getAllLocalesCache(); $contents = $allLocalesCache->getContents(); } return $contents; }
/** * Return a list of all available locales. * @return array */ function &getAllLocales() { $cache =& AppLocale::_getAllLocalesCache(); $rawContents = $cache->getContents(); $allLocales = array(); foreach ($rawContents as $locale => $contents) { $allLocales[$locale] = $contents['name']; } // if client encoding is set to iso-8859-1, transcode locales from utf8 if (LOCALE_ENCODING == "iso-8859-1") { $allLocales = array_map('utf8_decode', $allLocales); } return $allLocales; }