當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。