Gets the full url for node

@param string $locale
@return string
501869
public function getSiteURL($locale = null)
    {
        $node = $this;
        $uri = '';

        do
        {
            $uri = '/' . $node->getTranslationAttribute('node_name', $locale) . $uri;
            $node = is_null($node->parent_id) ? null : node_bag($node->parent_id, false);
        } while ( ! is_null($node) && $node->home != '1');

        return url($uri);
    }
649507
public function countryCodeByLocale($locale)
    {
        if (str_contains($locale, ' ')) {
            $locale = str_replace(' ', '-', $locale);
        }

        if (strlen($locale) == 2) {
            if ($locale == 'en') {
                $locale = 'en-US';
            } else {
                $locale = $locale.'-'.strtoupper($locale);
            }
        }

        return Locale::getRegion($locale);
    }
1123779
protected function getLocalizedTagContent(\SimpleXMLElement $element, $locale = null)
    {
        if (0 === $element->count()) {
            return '';
        }

        if (null === $locale) {
            return $this->multilineRemoveIndent((string)$element, 'true' === (string)$element->attributes()['removeIndent']);
        }

        foreach ($element as $node) {
            if ($locale == (string)$node->attributes()['locale']) {
                return $this->multilineRemoveIndent((string)$node, 'true' === (string)$node->attributes()['removeIndent']);
            }
        }

        $message = sprintf('Locale "%s" not available in node "%s".', $locale, $element->getName());
        throw new \Exception($message);
    }
32566
public function getTranslation(string $locale): ?string
    {
        if (! isset($this->text[$locale])) {
            $fallback = config('app.fallback_locale');

            return $this->text[$fallback] ?? null;
        }

        return $this->text[$locale];
    }
1134584
public function getAll($locale)
    {
        $qb = $this->createQueryBuilder('r');

        $qb->addSelect('t');
        $qb->innerJoin('r.translations', 't');
        $qb->andWhere('t.locale=:locale');
        $qb->setParameter(':locale', $locale);

        return $qb->getQuery()->execute();
    }
579609
public function getDocumentForNode(NodeInterface $node, $locale)
    {
        $identifier = $node->getIdentifier();
        $this->assertNodeExists($identifier);

        return $this->nodeDocumentMap[$this->getNodeLocaleKey($node->getIdentifier(), $locale)];
    }
1372378
protected function getLocalizedRedirect($locale)
    {
        return is_string($localizedUrl = $this->localization->getLocalizedURL($locale))
            ? $this->makeRedirectResponse($localizedUrl)
            : null;
    }
407346
public function getStructure($locale)
    {
        return $this->contentMapper->loadShallowStructureByNode($this->node, $locale, $this->webspace);
    }
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 '/';
    }
1239739
public function get($locale = 'en')
	{
		if (isset($this->stopwords[$locale])) {
			return $this->stopwords[$locale];
		}

		$this->stopwords[$locale] = [];

		$filename = $this->path . '/' . $locale . '.php';

		if (file_exists($filename)) {
			$this->stopwords[$locale] = require $filename;
		}

		return $this->stopwords[$locale];
	}
609874
public function getRouteNameFromPath($uri, $locale)
    {
        $attributes = Url::extractAttributes($uri);
        $uri        = str_replace([url('/'), "/$locale/"], '', $uri);
        $uri        = trim($uri, '/');

        foreach ($this->translatedRoutes as $routeName) {
            $url = Url::substituteAttributes($attributes, $this->translate($routeName));

            if ($url === $uri) return $routeName;
        }

        return false;
    }
1344509
public function LocaleInformation($locale = null)
    {
        // Check locale and get object
        if ($locale) {
            $localeObj = Locale::getByLocale($locale);
        } else {
            $localeObj = Locale::getDefault();
        }
        $locale = $localeObj->getLocale();

        // Check linking mode
        $linkingMode = $this->getLinkingMode($locale);

        // Check link
        $link = $this->LocaleLink($locale);

        // Store basic locale information
        return ArrayData::create([
            'Locale' => $locale,
            'LocaleRFC1766' => i18n::convert_rfc1766($locale),
            'URLSegment' => $localeObj->getURLSegment(),
            'Title' => $localeObj->getTitle(),
            'LanguageNative' => $localeObj->getNativeName(),
            'Language' => i18n::getData()->langFromLocale($locale),
            'Link' => $link,
            'AbsoluteLink' => $link ? Director::absoluteURL($link) : null,
            'LinkingMode' => $linkingMode
        ]);
    }
742752
public function getMailFields($locale = null)
    {
        $org         = $this->getBaseOrganization();
        $orgResults  = $org->getMailFields();
        $projResults = $this->project->getMailFields();

        $result['bcc']            = $projResults['project_bcc'];
        $result['email']          = $this->getEmailAddress();
        $result['first_name']     = $this->_getVar('user_first_name');
        $result['from']           = $this->getFrom();
        $result['full_name']      = trim($this->getGenderHello($locale) . ' ' . $this->getFullName());
        $result['greeting']       = $this->getGreeting($locale);
        $result['last_name']      = ltrim($this->_getVar('user_surname_prefix') . ' ') . $this->_getVar('user_last_name');
        $result['login_url']      = $orgResults['organization_login_url'];
        $result['name']           = $this->getFullName();
        $result['login_name']     = $this->getLoginName();

        $result = $result + $orgResults + $projResults;

        $result['reset_ask']      = $orgResults['organization_login_url'] . '/index/resetpassword';
        $result['reset_in_hours'] = $this->definition->getResetKeyDurationInHours();
        $result['reply_to']       = $result['from'];
        $result['to']             = $result['email'];

        return $result;
    }
588935
private function getAlternate($url, $webspaceKey, $locale, $default = false)
    {
        $url = $this->contentPath->getContentPath($url, $webspaceKey, $locale);

        return sprintf(
            '<link rel="alternate" href="%s" hreflang="%s" />',
            $url,
            !$default ? str_replace('_', '-', $locale) : 'x-default'
        );
    }
877616
private function executeQuery(string $url, string $locale = null): string
    {
        if (null !== $locale) {
            $url = sprintf('%s&accept-language=%s', $url, $locale);
        }

        return $this->getUrlContents($url);
    }
1227704
public static function getLanguage($locale)
    {
        return isset(self::$locales[$locale])
            ? self::$locales[$locale]
            : $locale;
    }
476315
public static function setLocale($locale = null) {
        $app = app();
        $currentLocale = $app->config->get('app.locale');
        if (empty($locale) || !is_string($locale)) {
            // If the locale has not been passed through the function
            // it tries to get it from the first segment of the url
            $locale = $app->request->segment(1);
        }
        if (!in_array($locale, $app->config->get('sirgrimorum.crudgenerator.list_locales'))) {
            $locale = $currentLocale;
        }

        //if (!empty($this->supportedLocales[$locale])) {
        $currentLocale = $locale;
        //}

        $app->setLocale($currentLocale);

        return $currentLocale;
    }