Load language from uri position.

@return bool
512028
protected function loadFromUri()
    {
        if ( ! $this->uriPosition) {
            return false;
        }

        $url = Yii::$app->request->getAbsoluteUrl();
        $parse = parse_url($url);
        if ( ! empty($parse)) {
            $path = explode('/', trim($parse['path']), $this->uriPosition + 1);
            is_string($path) and $path = [$path];
            if (isset($parse[$this->uriPosition - 1])) {
                return $parse[0];
            }
        }

        return false;
    }
593686
public function baseIncludingLanguage()
    {
        $grav = Grav::instance();

        /** @var Pages $pages */
        $pages = $grav['pages'];

        return $pages->baseUrl(null, false);
    }
685587
public function loadTranslations()
    {
        $directory = $this->getDirectory().'/../../resources/lang';

        $this->loadTranslationsFrom($directory, 'amethyst-'.$this->getPackageName());

        $this->publishes([
            $directory => resource_path('lang/vendor/amethyst'),
        ], 'resources');
    }
1001155
private function load_strings() {
		if (file_exists(Config::$cache_directory . '/' . $this->language->name_short . '/' . $this->application_name . '.php')) {
			require Config::$cache_directory . '/' . $this->language->name_short . '/' . $this->application_name . '.php';
			$this->strings = $strings;
		}
	}
1264703
public function detectCurrentLanguage()
    {
        // parsing url to get only path & removing prefix if there is one
        $escapedPathPrefix = Text::escapeForRegex($this->config->getPathPrefix());
        $uriPath = parse_url($this->config->getRaw(), PHP_URL_PATH);
        $uriPath = preg_replace('/^' . $escapedPathPrefix . '/s', '', $uriPath);
        $uriSegments = explode('/', $uriPath);

        if (isset($uriSegments[1]) && in_array($uriSegments[1], $this->translate->getLanguages())) {
            return $uriSegments[1];
        }
        return $this->translate->getDefault();
    }
1274309
public static function load()
    {
        if (is_null(self::$loader)) {
            // Create loader object
            self::$loader = new \PhpMyAdmin\MoTranslator\Loader();

            // Set locale
            self::$loader->setlocale(
                self::$loader->detectlocale()
            );

            // Set default text domain
            self::$loader->textdomain('sqlparser');

            // Set path where to look for a domain
            self::$loader->bindtextdomain('sqlparser', __DIR__ . '/../locale/');
        }

        if (is_null(self::$translator)) {
            // Get translator
            self::$translator = self::$loader->getTranslator();
        }
    }
303246
private function _loadLanguageItems()
    {
        $this->_languageItems = LanguageSource::find()
            ->joinWith(['languageTranslate' => function ($query) {
                $query->where(['language' => $this->_languageId]);
            },
            ])
            ->where(['category' => Scanner::CATEGORY_JAVASCRIPT])
            ->all();
    }
1374077
public function load($url, $override = false)
    {
        if (!$this->isLoaded($url))
        {
            $translations = array();

            foreach ($this->find($url) as $file)
            {
                try {
                    $loaded = $this->getObject('object.config.factory')->fromFile($file)->toArray();
                } catch (Exception $e) {
                    return false;
                }

                $translations = array_merge($translations, $loaded);
            }

            $this->getCatalogue()->add($translations, $override);

            $this->setLoaded($url);
        }

        return true;
    }
1364630
public function parseUri()
    {
        $uri = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null);

        if(isset($uri))
        {
            $uri = '/' . ltrim(trim($uri), '/');
            $uri = filter_var($uri, FILTER_SANITIZE_URL);

            return $uri;
        }
        else
        {
            throw new Exception("Error parsing URI please check your URI.", 1);
        }
    }
947314
public function getUri()
    {
        if (!$this->uri)
            $this->uri = new Uri($this->httpMessage->getTarget());
        
        return $this->uri;
    }
389978
static public function urlTranslationEnabledByUri( eZURI $uri )
    {
        if ( $uri->isEmpty() )
            return false;

        $ini = eZINI::instance();
        if ( $ini->variable( 'URLTranslator', 'Translation' ) === 'enabled' )
        {
            if ( $ini->variable( 'URLTranslator', 'TranslatableSystemUrls' ) === 'disabled' )
            {
                $moduleName = $uri->element( 0 );
                $moduleINI  = eZINI::instance( 'module.ini' );
                $moduleList = $moduleINI->variable( 'ModuleSettings', 'ModuleList' );
                if ( in_array( $moduleName, $moduleList, true ) )
                  return false;
            }
            return true;
        }
        return false;
    }
884865
private function getLanguage()
    {
        $wpLang = (function_exists('get_locale')) ? get_locale() : null;
        $browserLang = null;
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $browserLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
        }

        return  substr($wpLang ?: $browserLang ?: 'en', 0, 2);
    }
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);
	}
368397
private function parseUri() {
		$this->env['request'] = substr($this->env['request_uri'], strlen($this->env['path']) - 1);

		if (preg_match_all('/\/([A-Za-z0-9-_]+)/', $this->env['request'], $matches)) {
			foreach ($matches[1] as $match) {
				$this->env['params'][] = $match;
			}
		}

		if (!empty($this->env['params'][0])) {
			$this->env['params']['strategy'] = $this->env['params'][0];
		}
		if (!empty($this->env['params'][1])) {
			$this->env['params']['action'] = $this->env['params'][1];
		}
	}
21967
public function uri()
    {
        $filters = $this->queryFilters();

        $uri = static::BASE_URI . '/sms/admin/v1/statistics';

        return count($filters) ? $uri.'?'.http_build_query($filters) : $uri;
    }
1178607
public function load($overwrite = false)
	{
		$paths = $this->find_file();

		$lang = array();

		foreach ($paths as $path)
		{
			$lang = $overwrite ?
				array_merge($lang, $this->load_file($path)) :
				\Arr::merge($lang, $this->load_file($path));
		}

		return $lang;
	}
281652
function load( $uri, $extraParameters = false, $returnResourceData = false )
    {
        $resourceData = $this->loadURIRoot( $uri, true, $extraParameters );
        if ( !$resourceData or
             $resourceData['root-node'] === null )
        {
            $retValue = null;
            return $retValue;
        }
        else
            return $resourceData['root-node'];
    }