本文整理汇总了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);
}
}