public static function install_locale($persist = true)
{
// Ensure the locale is set correctly given the designated parameters
$locale = self::current_locale($persist);
if (empty($locale)) {
return;
}
i18n::set_locale($locale);
// LC_NUMERIC causes SQL errors for some locales (comma as decimal indicator) so skip
foreach (array(LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_TIME) as $category) {
setlocale($category, "{$locale}.UTF-8", $locale);
}
// Get date/time formats from Zend
require_once 'Zend/Date.php';
i18n::config()->date_format = Zend_Locale_Format::getDateFormat($locale);
i18n::config()->time_format = Zend_Locale_Format::getTimeFormat($locale);
}