当前位置: 首页>>代码示例>>PHP>>正文


PHP locale::get_locale_information方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:49,代码来源:locale.class.php


注:本文中的locale::get_locale_information方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。