Loads language strings from cache.

@param  string $language Name of the language pack
@param  string $file     File from which we are loading the strings
@return bool
331718
protected function loadFromCache(string $language, string $file): bool
	{
		$this->strings[$language] = $this->cache->get('mako.i18n.' . $language);

		return $this->strings[$language] !== false && isset($this->strings[$language][$file]);
	}
713591
static function load($name){

		$lang = Config::read('App.Base.language');
		
		$prop = Loader::getName($name,'locale'.DS.$lang);
		
		// if file already loaded? if so done!
		if(isset(self::$language[$prop->app])){
			return self::$language[$prop->app];
		}
		
		// is file not exists?
		if(!file_exists($prop->path)){
			user_error('Language Not Found '.$prop->path);
			exit;
		}

		self::$language[$prop->app] = (require_once $prop->path);
	}
963786
public function loadFile($file, $format = 'ini', $package = null)
    {
        $config = $this->config;

        $format = $format ?: $config->get('language.format', 'ini');

        $default = $config['language.default'] ?: 'en-GB';
        $locale  = $config['language.locale'] ?: 'en-GB';

        $ext = $format == 'yaml' ? 'yml' : $format;

        $default = LanguageNormalize::toLanguageTag($default);
        $locale  = LanguageNormalize::toLanguageTag($locale);

        // If package name exists, we load package language first, that global can override it.
        if (is_string($package)) {
            $package = $this->packageResolver->getPackage($package);
        }

        if ($package instanceof AbstractPackage) {
            $path = $package->getDir() . '/Resources/language/%s/%s.%s';

            // Get Package language
            if (!$config->get('language.debug') || $locale == $default) {
                $this->loadLanguageFile(sprintf($path, $default, $file, $ext), $format);
            }

            // If locale not equals default locale, load it to override default
            if ($locale != $default) {
                $this->loadLanguageFile(sprintf($path, $locale, $file, $format), $format);
            }
        }

        // Get Global language
        $path = $config->get('path.languages') . '/%s/%s.%s';

        if (!$config->get('language.debug') || $locale == $default) {
            $this->loadLanguageFile(sprintf($path, $default, $file, $format), $format);
        }

        // If locale not equals default locale, load it to override default
        if ($locale != $default) {
            $this->loadLanguageFile(sprintf($path, $locale, $file, $format), $format);
        }

        return $this;
    }
643261
protected function loadLanguageFile($file, $format)
    {
        if (is_file($file)) {
            $this->load($file, $format);

            $loaded = $this->config['language.loaded'];

            $loaded[] = $file;

            $this->config->set('language.loaded', $loaded);
        }

        return $this;
    }
397163
private function loadTranslations($language)
    {
        $language = (string) $language;
        if ($language === '') {
            throw new \InvalidArgumentException('$language cannot be empty');
        }

        if (!isset($this->translations[$language])) {
            $this->translations[$language] = [];
        }

        if (isset($this->files[$language])) {
            foreach ($this->files[$language] as $file) {
                if (is_file($file)) {
                    $this->translations[$language] = array_merge(
                        $this->translations[$language],
                        $this->getTranslationArrayFromFile($file)
                    );
                } elseif (is_dir($file)) {
                    $it = new \RecursiveDirectoryIterator($file, \FilesystemIterator::SKIP_DOTS);
                    $it = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::SELF_FIRST);

                    foreach ($it as $file) {
                        if (is_file($file->getRealPath())) {
                            $this->translations[$language] = array_merge(
                                $this->translations[$language],
                                $this->getTranslationArrayFromFile($file->getRealPath()));
                        }
                    }
                }
            }
        }
    }
1090565
public static function loadFile($file)
    {
        $json = new Json();

        return self::create($json->decodeFile($file), $json);
    }
941182
private function loadLanguageData(string $language = 'de')
  {
    if (\in_array($language, self::$availableLanguages, true) === false) {
      throw new StopWordsLanguageNotExists('language not supported: ' . $language);
    }

    $this->stopWords[$language] = $this->getData($language);
  }
1182878
public function load_from_file($file)
    {
        $success = false;

        foreach ($this->resolve_paths($file) as $fpath) {
            if ($fpath && is_file($fpath) && is_readable($fpath)) {
                // use output buffering, we don't need any output here
                ob_start();
                include($fpath);
                ob_end_clean();

                if (is_array($config)) {
                    $this->merge($config);
                    $success = true;
                }
                // deprecated name of config variable
                if (is_array($rcmail_config)) {
                    $this->merge($rcmail_config);
                    $success = true;
                }
            }
        }

        return $success;
    }
318922
public function load($file)
    {
        if (!is_file($file)) {
            if (!$file = $this->findFile($file)) {
                throw new \RuntimeException(sprintf('Language file: %s not found.', $file));
            }
        }

        return include $file;
    }
181304
private function load()
    {
        // reset phrases
        $this->phrases = array();
        $this->loaded = true;

        // set file path
        $langDataPath = FS2LANG . '/' . $this->local . '/' . $this->type . '.txt';

        // include language data file
        if (file_exists($langDataPath)) {
            // load file
            $langData = file_get_contents($langDataPath);
            $langData = str_replace(array("\r\n", "\r"), "\n", $langData); // unify linebreaks
            $this->import($langData);

            // get lines
            $langData = preg_replace("/#.*?\n/is", '', $langData);
            $langData = explode("\n", $langData);

            // Run through lines
            foreach ($langData as $line) {
                preg_match("#([a-z0-9_-]+?)\s*?:\s*(.*)#is", $line, $match);
                if (count($match) >= 2) {
                    $this->add($match[1], $match[2]);
                }
                unset($match);
            }
        } else {
            Throw new \Exception('Language File not found: ' . $langDataPath);
        }
    }
966955
public function loadIgnore(string $file)
    {
        if (file_exists($this->getThemePath() . $this->sanitizeFileName($file))) {
            return $this->load($file);
        }

        return false;
    }
1258586
private function loadFile ($file)
	{
		if (!isset ($this->files[$file]))
		{
			$filename = $this->folder . $file . '.php';

			// First load these
			if (file_exists ($filename))
			{
				$this->files[$file] = include ($filename);
			}

			// Now overload with environment values
			if (isset ($this->environment))
			{
				$filename = $this->folder . $this->environment . '/' . $file . '.php';
				if (file_exists ($filename))
				{
					$this->merge ($file, include ($filename));
				}
			}

		}
	}
264970
public function has(string $key, ?string $language = null): bool
	{
		[$file, $string] = $this->parseKey($key);

		if($string === null)
		{
			return false;
		}

		$strings = $this->getStrings($language ?? $this->language, $file);

		return Arr::has($strings, $string) && is_string(Arr::get($strings, $string));
	}
272047
public function loadAllFile($folder, $language = "default") {
        $this->folder = $folder;
        $this->language = $language;
		
        $msg = array();
        if($language == "default")
            @include($folder."message.php");
        else
        @include($folder."message_".$language.".php");

        /*
         * Some OSes don't distinguish between empty array and FALSE (they may return FALSE in case of no match),
         * therefore the foreach may trigger a Warning even if there is no error
         */
        $ressourceFiles = glob($folder."message_custom_".$language."_*.php");
        if ($ressourceFiles){
            foreach ($ressourceFiles as $filename) {
                @include($filename);
            }
        }

        $this->msg = $msg;
    }
1110034
public function load(string $file)
    {
        $this->data = Yaml::parse(file_get_contents($file));
        $this->filename = basename($file);
    }
519570
public function loadFile(string $file)
    {
        $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));
        switch ($extension) {
            case "ini":
                $this->loadIni($file);
                break;
            case "xml":
                $this->loadXml($file);
                break;
            case "yml":
                $this->loadYaml($file);
                break;
            case "php":
                $this->loadPhp($file);
                break;
            default:
                //不用处理
                break;
        }
    }
1280935
public function loadTranslation($file)
    {
        $translations = &gplcart_static("translation.$file");

        if (isset($translations)) {
            return (array) $translations;
        }

        $translations = array();

        if (empty($file) || !is_file($file)) {
            return $translations = array();
        }

        foreach ($this->parseCsv($file) as $row) {
            $key = array_shift($row);
            $translations[$key] = $row;
        }

        return $translations;
    }