Retrieve the object's URI.

@param  string|null $lang If object is multilingual, return the object route for the specified locale.
@return Translation|string|null
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);
    }
57589
private function loadTranslation($language) {
        $translation = null;
        /** @var \yii\db\ActiveQuery $relation */
        $relation = $this->owner->getRelation($this->relation);
        /** @var ActiveRecord $class */
        $class = $relation->modelClass;
        $language = strtolower($language);
        if ($this->owner->getPrimarykey()) {
            $translation = $class::findOne(
                            [$this->languageField => $language, key($relation->link) => $this->owner->getPrimarykey()]
            );
        }
        if ($translation === null) {
            $translation = new $class;
            $translation->{key($relation->link)} = $this->owner->getPrimaryKey();
            $translation->{$this->languageField} = $language;
        }
        return $translation;
    }
1032932
public function getLanguageCode($language = null)
    {
        if ($language === null) {
            $language = $this->_language;
        }
        $code = KlarnaLanguage::getCode($language);

        return (string) $code;
    }
487145
public function getLocaleText($input, ?string $lang = null, ?string $default = null): ?string
    {
        // define language if empty
        if ($lang === null) {
            $lang = App::$Request->getLanguage();
        }
        // unserialize from string to array
        if (Any::isStr($input)) {
            $input = Serialize::decode($input);
        }

        if (Any::isArray($input) && array_key_exists($lang, $input)) {
            return $input[$lang];
        }

        return $default;
    }
1061156
public function uri($locale = null)
    {
        $uri = $this->page->uri($locale).'#'.$this->position.'-'.$this->translate('slug', $locale);

        return $uri;
    }
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];
    }
982031
public function getKeyword($keyword, $lang = null)
    {
        $parts = $this->_callInternalLocale('getKeywords', null, $lang, false);
        return isset($parts[$keyword]) ? $parts[$keyword] : null;
    }
549545
public static function getMetadata($lang)
	{
		$path = self::getLanguagePath(JPATH_ROOT, $lang);
		$file = $lang . '.xml';

		$result = null;

		if (is_file("$path/$file"))
		{
			$result = self::parseXMLLanguageFile("$path/$file");
		}

		if (empty($result))
		{
			return null;
		}

		return $result;
	}
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;
    }
1156332
public function getKeyword($language = null)
    {
        if (empty($language)) {
            $language = $this->mainLanguageCode;
        }

        if (!is_array($this->keywords) || !array_key_exists($language, $this->keywords)) {
            return null;
        }

        return $this->keywords[$language];
    }
1267842
public function getLangFallbacks( $lang ) {
		if ( self::$fallbackCache === null ) {
			// Lazy-initialize
			self::$fallbackCache = $this->fetchLangFallbacks();
		}

		$lang = $this->normalizeLang( $lang );
		return isset( self::$fallbackCache[$lang] ) ? self::$fallbackCache[$lang] : [ 'en' ];
	}
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;
    }
913066
public function getShopUrl($lang = null, $admin = null)
    {
        $url = null;
        $admin = isset($admin) ? $admin : $this->isAdmin();

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

        if (!$url) {
            $url = $this->getConfigParam('sShopURL');
        }

        return $url;
    }
611308
public function getTranslation($lang)
    {
        // Check if locale given
        if (strpos($lang, '_')) {
            $parts = explode('_', $lang);
            $lang = array_shift($parts);
        }

        foreach ($this->getTranslations() as $translation) {
            if ($translation->getLang() === $lang) {
                return $translation;
            }
        }

        $translation = new EmailTranslation($lang);
        $translation->setEmail($this);

        return $translation;
    }
288572
public function uri($locale = null)
    {
        $locale = $locale ?: config('app.locale');
        $route = $locale.'::'.Str::singular($this->getTable());
        if (Route::has($route)) {
            return route($route, $this->slug);
        }

        return '/';
    }
614568
public function children($lang='',$alias=''){
		$collname=$this->collectionName;
		$bitems=$collname::GetInstance();
		$children=$bitems->itemsFilter(array('parent'=>$this->id));
		if(empty($alias)){
			return $children;
			}
		foreach($children as $ch){
			$chalias=$ch->getalias($lang);
			if($chalias==$alias){
				return $ch;
				}
			}
		return NULL;
		}
506160
public function getTree($lang = null) {
		if (is_null($lang)) $lang = $this->_language;

		$file = $this->_language_path . $lang . '/tree.php';
		return $this->_loadFile($file);
	}