设置或者获取当前的语言
@access public
@param string $lang 语言名
@return string|Request
165737
public function langset($lang = null)
    {
        if (!is_null($lang)) {
            $this->langset = $lang;
            return $this;
        } else {
            return $this->langset ?: '';
        }
    }
1260106
public function setLanguage($lang)
    {
      if (isset($this->commonUploadErrors[$lang])) {
        $this->language = $lang;
      } else {
        $this->error = $this->commonUploadErrors[$this->language]['ERROR_09'];
      }

      return $this;
    }
611308
public function getTranslation($lang)
    {
        // Check if locale given
        if (strpos($lang, '_')) {
            $parts = explode('_', $lang);
            $lang = array_shift($parts);
        }

        foreach ($this->getTranslations() as $translation) {
            if ($translation->getLang() === $lang) {
                return $translation;
            }
        }

        $translation = new EmailTranslation($lang);
        $translation->setEmail($this);

        return $translation;
    }
1349192
public static function get($string, $lang = null)
    {
        if ( ! $lang)
        {
            $lang = self::$lang;
        }
        // 加载语言表
        $table = self::load($lang);

        return isset($table[$string]) ? $table[$string] : $string;
    }
614573
public static function load($lang)
    {
        if (isset(self::$_cache[$lang]))
        {
            return self::$_cache[$lang];
        }

        $table = [];
        $parts = explode('-', $lang);

        do
        {
            $path = implode(DIRECTORY_SEPARATOR, $parts);

            $files = [];
            foreach (self::$_i18nPaths as $includePath)
            {
                if (is_file($includePath . $path . self::$ext))
                {
                    $files[] = $includePath . $path . self::$ext;
                }
            }

            if ( ! empty($files))
            {
                $t = [];
                foreach ($files as $file)
                {
                    $t = array_merge($t, Base::load($file));
                }
                $table += $t;
            }
            array_pop($parts);
        }
        while ($parts);

        return self::$_cache[$lang] = $table;
    }
723994
public static function set_current( $lang ) 
	{
		$lang = static::parse( $lang );
		
		if ( !array_key_exists( $lang, static::$data ) ) 
		{
			static::$data[$lang] = array();
		}
		
		return static::$current_language = $lang;
	}
145953
public function get(string $openid, string $lang = 'zh_CN')
    {
        $params = [
            'openid' => $openid,
            'lang' => $lang,
        ];

        return $this->httpGet('cgi-bin/user/info', $params);
    }
67269
public function lang($lang = NULL)
	{
		if ( ! func_num_args())
		{
			return $this->_lang;
		}
		$this->_lang = $lang;
		return $this;
	}
438178
protected function split_lang($lang)
	{
		if ( ! isset($this->_fallback_paths[$lang]))
		{
			$splits = array();
			$lang_parts = explode('-', $lang);
			while ($lang_parts)
			{
				$splits[] = implode('-', $lang_parts);
				array_pop($lang_parts);
			}
			$this->_fallback_paths[$lang] = $splits;
		}
		return $this->_fallback_paths[$lang];
	}
1314276
public static function get($key, array $params = [], $lang = null)
    {
        $lang = $lang ?: static::$lang;
        if(static::has($key)) {
            $string = static::$langs[$lang][$key];
            foreach($params as $placeholder => $value) {
                $string = str_replace('{' . $placeholder . '}', $value, $string);
            }

            return $string;
        }

        return $key;
    }
1220377
public function findOneLangRoot(Lang $lang, bool $refresh = FALSE) : ?Page
    {
        if (!$this->langRoot || $refresh)
        {
            $langRoot = PageQuery::create()
                ->usePageUrlQuery()
                    ->filterByLang($lang)
                ->endUse()
                ->filterByTreeLevel(1)
                ->orderByTreeLeft()
                ->findTree()
                ->getFirst();

            $this->langRoot = $langRoot;
        }

        return $this->langRoot;
    }
905746
public static function setLang($lang)
    {
        phpCAS::_validateClientExists();

        try {
            self::$_PHPCAS_CLIENT->setLang($lang);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }
    }
464825
public function data($lang=null) {

        if ($lang) {
            return isset($this->_languages[$lang]) ? $this->_languages[$lang] : [];
        }

        return $this->_languages;
    }
590242
public function load($lang) {
        $langDir = MODULES_DIR . DS . RouteController::$currentModule . '/Views/lang/' . $lang;

        $files = glob($langDir . "/*.php");
        if (count($files) == 0) {
            throw new \Exception(ExceptionMessages::TRANSLATION_FILES_NOT_FOUND);
        }

        foreach ($files as $file) {
            $fileInfo = pathinfo($file);
            self::$translations[$fileInfo['filename']] = require_once $file;
        }
    }
1328398
public static function getInstance($lang, $debug = false)
	{
		if (!isset(self::$languages[$lang . $debug]))
		{
			$language = new self($lang, $debug);

			self::$languages[$lang . $debug] = $language;

			// Check if Language was instantiated with a null $lang param;
			// if so, retrieve the language code from the object and store
			// the instance with the language code as well
			if (is_null($lang))
			{
				self::$languages[$language->getLanguage() . $debug] = $language;
			}
		}

		return self::$languages[$lang . $debug];
	}
974018
public function getPlaceholder($lang = null)
    {
        $lang = empty($lang) ? $this->getDefaultLanguage() : $lang;

        if (!isset($this->placeholders[$lang])) {
            return $this->getFirstPlaceholder();
        }

        return $this->placeholders[$lang];
    }
913066
public function getShopUrl($lang = null, $admin = null)
    {
        $url = null;
        $admin = isset($admin) ? $admin : $this->isAdmin();

        if (!$admin) {
            $url = $this->getShopUrlByLanguage($lang);
            if (!$url) {
                $url = $this->getMallShopUrl();
            }
        }

        if (!$url) {
            $url = $this->getConfigParam('sShopURL');
        }

        return $url;
    }