Ejemplo n.º 1
0
 /**
  * 返回一个语言包语句
  *
  * @param string $string
  * @return string
  */
 public static function get($string)
 {
     $string = trim($string);
     $lower_str = strtolower($string);
     if (false === self::$core_initialized) {
         if (defined('SYSTEM_LOADED_TIME')) {
             self::$core_initialized = true;
         }
     }
     if (self::$core_initialized) {
         $p = Core::$project;
     } else {
         $p = '..core..';
     }
     if (isset(self::$lang[$p][$lower_str])) {
         return self::$lang[$p][$lower_str];
     }
     # 初始化
     if (!isset(self::$is_setup[$p]) && false === self::$is_setuping) {
         self::$is_setuping = true;
         self::setup();
         self::$is_setuping = false;
     } else {
         return $string;
     }
     return isset(self::$lang[$p][$lower_str]) ? self::$lang[$p][$lower_str] : $string;
 }