Get a language URL.

@param string $language The language.
@return string Returns the language URL.
@throws FileNotFoundException Throws a file not found exception if the language file does not exist.
172427
public static function getLanguageURL($language) {

        // Initialize the directory.
        $dir = ObjectHelper::getDirectory(JQueryDataTablesBundle::class);
        $dir .= "/Resources/public/datatables-i18n/%language%.json";

        // Initialize the URI.
        $uri = "/bundles/jquerydatatables/datatables-i18n/%language%.json";

        // Initialize the URL.
        $url = StringHelper::replace($uri, ["%language%"], [$language]);

        // Initialize and check the filename.
        $file = StringHelper::replace($dir, ["%language%"], [$language]);
        if (false === file_exists($file)) {
            throw new FileNotFoundException(null, 500, null, $url);
        }

        return $url;
    }
731562
public function getLanguage(string $lang): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/language/$lang/")));
    }
179676
public function getSlug($language = null)
    {
        $slugify = new Slugify();

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

        return $this->getLanguages()->get($language);
    }
1277738
public function getLanguage() : ?string 
    {
        if ( ! $this->hasLanguage()) {
            $this->setLanguage($this->getDefaultLanguage());
        }
        return $this->language;
    }
55884
public function getSslShopUrl($lang = null)
    {
        $url = $this->getShopUrlByLanguage($lang, true);

        if (!$url) {
            $url = $this->getMallShopUrl(true);
        }

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

        //normal section
        if (!$url) {
            $url = $this->getConfigParam('sSSLShopURL');
        }

        if (!$url) {
            $url = $this->getShopUrl($lang);
        }

        return $url;
    }
329604
public function get_language_fullname($language)
    {
        //Clean up the language name to prevent malicious code injection
        $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);

        $language = strtolower($language);

        // get fullpath-filename for a langname
        $fullpath = $this->language_path.$language.'.php';

        // we need to get contents :S
        if (false === ($data = file_get_contents($fullpath))) {
            $this->error = sprintf('Geshi::get_lang_fullname() Unknown Language: %s', $language);
            return false;
        }

        // match the langname
        if (!preg_match('/\'LANG_NAME\'\s*=>\s*\'((?:[^\']|\\\')+?)\'/', $data, $matches)) {
            $this->error = sprintf('Geshi::get_lang_fullname(%s): Regex can not detect language', $language);
            return false;
        }

        // return fullname for langname
        return stripcslashes($matches[1]);
    }
1349696
public function url(string $language = null): ?string
    {
        if ($this->route === null) {
            return null;
        }

        if ($language === null) {
            return urlMl(array_get($this->route, 'path'), app()->getLocale());
        }

        $route = array_first($this->routes, function ($route) use ($language) {
            return $route['language_code'] === $language && $route['is_active'] === true;
        });

        return urlMl(array_get($route, 'path'), $language);
    }
45270
public function getTranslation($language = null)
    {
        if (!$language) {
            $language = $this->getLanguage();
        }
        if (!isset($this->_models[$language])) {
            $this->_models[$language] = $this->getNewTranslation($language);
        }
        return $this->_models[$language];
    }
334252
public function getLanguageCode($lang = null)
    {
        $parts = $this->_callInternalLocale('parseLocale', null, $lang, false);
        return isset($parts['language']) ? $parts['language'] : null;
    }
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;
	}
60079
public function loadLanguage($language)
    {
        if ($this->isLoaded($language)) {
            return;
        }

        $langfile = $language . '.php';

        $this->strings[$language] = [];

        // Determine where the language file is and load it
        if (file_exists($this->filePath . $langfile)) {
            $this->strings[$language] = include $this->filePath . $langfile;
        }

        $this->languagesLoaded[] = $language;
    }
480813
public function url($lang = null)
    {
        if ($this->url === null) {
            if (!$this->id()) {
                return null;
            }

            $this->url = $this->generateUri();
        }

        if ($lang && $this->url instanceof Translation) {
            return $this->url[$lang];
        }

        return strval($this->url);
    }
1245723
protected function getMessageFilePath($category, $language)
    {
        $messageFile = $this->aliases->get($this->basePath) . "/$language/";
        if (isset($this->fileMap[$category])) {
            $messageFile .= $this->fileMap[$category];
        } else {
            $messageFile .= str_replace('\\', '/', $category) . '.php';
        }

        return $messageFile;
    }
566821
static function getLangByUrl($url = null)
    {
        if ($url === null) {
            return null;
        } else {
            $language = Lang::find()->where('url = :url', [':url' => $url])->one();
            if ( $language === null ) {
                return null;
            }else{
                return $language;
            }
        }
    }
871299
private function getMessageFile($language) {
		if(!isset($this->messageFile[$language])) {
			$this->messageFile[$language] = new MessageFileLanguage($this->getPath(), $language);
		}
		return $this->messageFile[$language];
	}
339337
public function getTranslation($language = null)
    {
        $language = $language ?: $this->getLanguage();

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

        $sourceLanguage = $this->getSourceLanguage();
        $attributes = isset($translations[$sourceLanguage]) ?
            ArrayHelper::toArray($translations[$sourceLanguage]) : [];

        $translations[$language] = $this->createTranslation($language, $attributes);

        $this->setTranslateRelations($translations);

        return $translations[$language];
    }