Check if a route is localized in a given language
@param string $name
@param string $lang
@return bool
142
function isLocalized($name,$lang=NULL) {
		if (!isset($lang))
			$lang=$this->current;
		return !$this->isGlobal($name) && array_key_exists($name,$this->_aliases) &&
				(!isset($this->rules[$lang][$name]) || $this->rules[$lang][$name]!==FALSE);
	}
1279361
function alias($name,$params=NULL,$lang=NULL) {
		if (in_array($name,$this->global_aliases))
			return $this->f3->alias($name,$params);
		if (!is_array($params))
			$params=$this->f3->parse($params);
		if (!$lang)
			$lang=$this->current;
		if (isset($this->rules[$lang][$name]) && $this->rules[$lang][$name]===FALSE)
			return FALSE;
		$url=isset($this->rules[$lang][$name])?
			$this->rules[$lang][$name]:@$this->_aliases[$name];
		if (!$url)
			user_error(sprintf(\Base::E_Named,$name),E_USER_ERROR);
		return $this->f3->build(rtrim('/'.$lang.$url,'/'),$params);
	}
74187
protected function isPrefix($name)
    {
        if (empty($this->prefix)) {
            return true;
        }

        return starts_with($name, $this->prefix);
    }
773728
def _is_lang_change(self, request):
        """"""
        if 'lang' not in request.GET:
            return False

        return not any(request.path.endswith(url) for url in self.exempt_urls)
70955
public function isRtl( $lang = null ) {
		static $rtlLanguages = null;

		$lang = $lang ? $this->normalizeLang( $lang ) : $this->getLang();

		if ( $rtlLanguages === null ) {
			$file = $this->localBaseDir . '/language/rtl.json';
			$rtlLanguages = json_decode( file_get_contents( $file ), true );
		}

		return in_array( $lang, $rtlLanguages );
	}
823002
public function setLang($lang = 'en-us') {
		$this->lang = $lang;

		try {
			$this->messages = parse_ini_file(__DIR__ . '/Lang/' . $this->lang . '.ini');
		} catch (Exception $e) {
			throw $e;
		}
	}
47896
public function hasGlobalMethod($name)
    {
        return
            isset($this->_appScopeTrait) &&
            isset($this->app->_hookTrait) &&
            $this->app->hookHasCallbacks('global-method-'.$name);
    }
755697
public function __isset( $name )
    {
        if ( $this->fields == null )
        {
            if ( $this->activeLanguage === null )
            {
                throw new Exception( "You need to define ezpFieldSet::activeLanguage to query fields directly" );
                return false;
            }
            else
            {
                return isset( $this->childrenFieldSets[$this->activeLanguage]->{$name} );
            }
        }
        else
        {
            return isset( $this->fields[$name] );
        }
    }
902361
public function isRtl(string $language): bool
    {
        $result = false;

        // Simplify and verify, just in case
        $language = $this->localeToLanguage($language);
        if (in_array($language, $this->getRtl())) {
            $result = true;
        }

        return $result;
    }
457129
public function getMissingLocalesForBlockName($name)
    {
        $locales = array();
        foreach ($this->locales as $locale)
        {
            if (!$this->hasContentBlock($name, $locale))
            {
                $locales[$locale] = $locale;
            }
        }

        return $locales;
    }
1106588
public function translationExists($lang, $alias) {
		$tree = $this->getTree($lang);

		foreach ($tree as $branch) {
			if (isset($branch[$alias])) return true;
		}
		return false;
	}
267977
public function getLanguagesAsHash($langlist,$name = true) {
		$hash = array();
		
		foreach ($langlist as $lang) {
			$hash[$lang['code']] = ($name)?$lang['name']:$lang['origname'];
		}
		
		return $hash;
	}
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;
	}
1023735
public static function setLanguage($lang)
    {
        static::$_appLanguage = Yii::$app->language;

        Yii::$app->language = $lang;
    }
67269
public function lang($lang = NULL)
	{
		if ( ! func_num_args())
		{
			return $this->_lang;
		}
		$this->_lang = $lang;
		return $this;
	}
818713
public function routeExists(string $name): bool
    {
        return null !== $this->router->getRouteCollection()->get($name);
    }
1107811
public function set_language( $lang = 'en-US' ) {
		if ( isset( $this->language ) && $this->language === $lang ) {
			return true; // Bail out, no need to do anything.
		}

		$success            = false;
		$language_file_name = \dirname( __FILE__ ) . '/lang/' . $lang . '.json';

		if ( \file_exists( $language_file_name ) ) {
			$raw_language_file = \file_get_contents( $language_file_name );

			if ( false !== $raw_language_file ) {
				$language_file = \json_decode( $raw_language_file, true );

				if ( false !== $language_file ) {
					$this->language           = $lang;
					$this->pattern_trie       = Trie_Node::build_trie( $language_file['patterns'] );
					$this->pattern_exceptions = $language_file['exceptions'];

					$success = true;
				}
			}
		}

		// Clean up.
		if ( ! $success ) {
			$this->language           = null;
			$this->pattern_trie       = null;
			$this->pattern_exceptions = [];
		}

		// Make sure hyphenationExceptions is not set to force remerging of patgen and custom exceptions.
		$this->merged_exception_patterns = null;

		return $success;
	}