本文整理匯總了PHP中locale::get_locale_information方法的典型用法代碼示例。如果您正苦於以下問題:PHP locale::get_locale_information方法的具體用法?PHP locale::get_locale_information怎麽用?PHP locale::get_locale_information使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類locale
的用法示例。
在下文中一共展示了locale::get_locale_information方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: locale
function locale($locale_string = '')
{
$this->http_locale_code = '';
$this->week_days = array(0, 1, 2, 3, 4, 5, 6);
$this->months = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
$locale = locale::get_locale_information($locale_string);
$this->country_code = $locale['country'];
$this->country_variation = $locale['country-variation'];
$this->language_code = $locale['language'];
$this->locale_code = $locale['locale'];
$this->charset = $locale['charset'];
$this->override_charset = $locale['charset'];
// Figure out if we use one locale file or separate country/language file.
$locale_ini =& $this->get_locale_ini();
$country_ini =& $locale_ini;
$language_ini =& $locale_ini;
if ($locale_ini === null) {
$country_ini =& $this->get_country_ini();
$language_ini =& $this->get_language_ini();
}
$this->_reset();
$this->is_valid = true;
if ($country_ini !== null) {
$this->_init_country_settings($country_ini);
} else {
$this->is_valid = false;
debug::write_error('Could not load country settings for ' . $this->country_code, __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
if ($language_ini !== null) {
$this->_init_language_settings($language_ini);
} else {
$this->is_valid = false;
debug::write_error('Could not load language settings for ' . $this->language_code, __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
// load variation if any
$locale_variation_ini =& $this->get_locale_ini(true);
$country_variation_ini =& $locale_variation_ini;
$language_variation_ini =& $locale_variation_ini;
if ($locale_variation_ini === null) {
$country_variation_ini =& $this->get_country_ini(true);
$language_variation_ini =& $this->get_language_ini(true);
}
if ($country_variation_ini !== null && $country_variation_ini->get_original_file() != $country_ini->get_original_file()) {
$this->_init_country_settings($country_variation_ini);
}
if ($language_variation_ini !== null && $language_variation_ini->get_original_file() != $language_ini->get_original_file()) {
$this->_init_language_settings($language_variation_ini);
}
}