Gets the navigation tree for the current language (or a passed language) from the `tree.php` file.
@param	string	$lang	A valid language string.
@return	`array`
506160
public function getTree($lang = null) {
		if (is_null($lang)) $lang = $this->_language;

		$file = $this->_language_path . $lang . '/tree.php';
		return $this->_loadFile($file);
	}
1344675
private function extractDataOfLanguage($lang)
    {
        $found = [];
        // parsing language preference instructions
        // 2_digit_code[-longer_code][;q=coefficient]
        preg_match('/([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?/', $lang, $found);
        // 2 digit lang code
        $code = isset($found[1]) ? $found[1] : null;
        // lang code complement
        $morecode = isset($found[3]) ? $found[3] : null;
        // full lang code
        $fullcode = $morecode ? $code.'-'.$morecode : $code;
        // coefficient
        $coef = sprintf('%3.1f', isset($found[5]) ? $found[5] : '1');
        // for sorting by coefficient
        // adding
        return array('code' => $code,'coef' => $coef,'morecode' => $morecode,'fullcode' => $fullcode);
    }
1125565
public function getLabel($lang = null)
    {
        $lang = empty($lang) ? $this->getDefaultLanguage() : $lang;

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

        return $this->labels[$lang];
    }
210476
public function getSuggestions($lang = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('users', 'suggestions');

		// Set the API path
		$path = '/users/suggestions.json';

		$data = array();

		// Check if entities is true
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}
1311210
public static function loadLang($lang)
	{
		$list = array ();
		// 框架语言包
		$file = ROOT_PATH . Config::get('@.LANG_PATH') . '/' . $lang . '.lang.php';
		if (is_file($file))
		{
			$data = include $file;
			$list = array_merge($list, $data);
		}
		// 项目语言包
		$file = APP_LANG . $lang . '.lang.php';
		if (is_file($file))
		{
			$data = include $file;
			$list = array_merge($list, $data);
		}
		// 获取模块名
		$m = Dispatch::module();
		// 是否开启模块
		if ('' !== $m)
		{
			// 模块语言包
			$file = APP_MODULE . $m . '/' . Config::get('@.LANG_PATH') . '/'. $lang .'.lang.php';
			if (is_file($file))
			{
				$data = include $file;
				$list = array_merge($list, $data);
			}
		}
		return $list;
	}
1069884
public function getContent($lang = null) {
		if (is_null($lang)) $lang = $this->_language;

		if ($this->_content == null) {
			$file = $this->_language_path . $lang . '/i18n.php';
			$this->_content = $this->_loadFile($file, false);
		}

		return $this->_content;
	}
1273167
public function get($language)
    {
        $result = array();
        if (isset($this->{$language})) {
            $result = $this->{$language};
        }
        if ($language !== 'nl' && isset($this->nl)) {
            $result += $this->nl;
        }
        return $result;
    }
1279308
private function loadLang($lang) {
        $locale = preg_replace_callback('/\b([a-z]{2})[-_](?:([a-z]{4})[-_])?([a-z]{2})\b/', function ($matches) {
            return $matches[1].'_'.(!empty($matches[2]) ? ucfirst($matches[2]).'_' : '').strtoupper($matches[3]);
        }, strtolower($lang));

        if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) {
            $this->lang = $locale;

            $this->number_word = include __DIR__.'/Lang/'.$locale.'.php';
            $this->currency = $this->number_word['currency'];

            return true;
        }
        throw new InvalidArgumentException('Unknown language ('.$lang.')');
    }
963348
public function menuPanelItems($lang = "")
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'read')) {
            return $this->noPermission();
        }

        // Find post types
        if(Input::input('keyword')) {
            $postTypes = PostType::where('name', 'like', '%test%')->paginate(PostType::$rowsPerPage);
        }else{
            $postTypes = PostType::where("slug", '!=', "post_pages")->paginate(PostType::$rowsPerPage);
        }

        // Append extra attributes
        foreach($postTypes->all() as $postType){
            $postType->belongsTo = 'post_type';
            $postType->belongsToID = $postType->postTypeID;
            $postType->label = $postType->name;
            $postType->menuLinkParameters = $postType->menuLinkParameters();
        }

        // Append columns
        $results = $postTypes->toArray();
        $results['columns'] = [
            'postTypeID' => trans('id'),
            'name' => trans('base.title'),
        ];

        return $results;
    }
165737
public function langset($lang = null)
    {
        if (!is_null($lang)) {
            $this->langset = $lang;
            return $this;
        } else {
            return $this->langset ?: '';
        }
    }
1371321
public function getOptionsByLang($lang = 'en')
    {
        $finalOptions = [];

        foreach ($this->getOptions() as $options) {
            foreach ($options as $option) {
                if ($option->lang == $lang || $option->isPlain) {
                    $finalOptions[] = $option;
                }
            }
        }

        return empty($finalOptions) ? null : $finalOptions;
    }
1199654
public static function GetLocale($lang)
	{
		if (array_key_exists($lang, LocaleFactory::$_locales))
			return LocaleFactory::$_locales[$lang];
		
		$locale = new CultureInfo($lang);

		LocaleFactory::$_locales[$lang] = $locale;

		return $locale;
	}
731562
public function getLanguage(string $lang): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/language/$lang/")));
    }
150391
public function setTranslatableLang($lang)
    {
        if (is_string($lang)) {
            $lang = new Lang($lang);
        }

        $this->translatableLang = $lang;

        return $this;
    }
141
private function getTranslationGroups($lang = 'en'): void
    {
        $dir = resource_path('lang/'. $lang . '/');
        $files = array_diff(scandir($dir), array('..', '.'));

        foreach($files as $index => $filename){
            $groupname = str_replace(".php", "", $filename);
            $this->updateTranslationGroups($groupname);
        }

    }
147434
public function getLanguage($language)
    {
        if (!$this->getLanguages()->has($language)) {
            $this->getLanguages()->set($language, new LanguageBag());
        }

        return $this->getLanguages()->get($language);
    }
1107840
public function getNodeTranslationsQueryBuilder($lang = null)
    {
        $queryBuilder = $this->createQueryBuilder('nt')
            ->select('nt,n,v')
            ->innerJoin('nt.node', 'n')
            ->leftJoin(
                'nt.publicNodeVersion',
                'v',
                'WITH',
                'nt.publicNodeVersion = v.id'
            )
            ->where('n.deleted = false')
            ->orderBy('nt.weight')
            ->addOrderBy('nt.weight');

        if (!empty($lang)) {
            $queryBuilder
                ->andWhere('nt.lang = :lang')
                ->setParameter('lang', $lang);
        }

        return $queryBuilder;
    }