If victoire_i18n.locale_pattern == domain, then we force the url rewrite with a valid host.

@param $locale

@return null
355741
protected function getPrefix($locale)
    {
        foreach ($this->localeResolver->getDomainConfig() as $_domain => $_locale) {
            if ($_locale === $locale) {
                $urlPrefix = sprintf('%s://%s', $this->request ? $this->request->getScheme() : 'http', $_domain);
                if ($this->request && $this->request->getPort()) {
                    $urlPrefix .= ':'.$this->request->getPort();
                }

                return $urlPrefix;
            }
        }
    }
579459
public function getUrl($locale = null)
    {
        if (null === $locale) {
            $locale = $this->getLocale();
        }

        return URL::getInstance()->retrieve($this->getRewrittenUrlViewName(), $this->getId(), $locale)->toString();
    }
650461
public function locale($locale = null)
    {
        if ($locale) {
            $this->_locale = $locale;
        }
        if ($this->_locale) {
            return $this->_locale;
        }
        if (isset($this->_params['locale'])) {
            return $this->_params['locale'];
        }
    }
1024213
protected function loadDomain($domain, $locale)
    {
        $event = new LoadLanguageFileEvent($domain, $locale);

        $this->eventDispatcher->dispatch(ContaoEvents::SYSTEM_LOAD_LANGUAGE_FILE, $event);
    }
1190523
public static function getLanguageFromLocale($locale)
    {
        if (strpos($locale, '_')) {
            $parts = explode('_', $locale);

            return strtolower($parts[0]);
        }

        return $locale;
    }
800855
static function idByLocale( $locale )
    {
        $language = eZContentLanguage::fetchByLocale( $locale );
        if ( $language )
        {
            return (int)$language->attribute( 'id' );
        }
        else
        {
            return false;
        }
    }
81011
public function setLocale($locale)
    {
        if ($locale && !is_string($locale)) {
            throw new InvalidArgumentException("Invalid locale");
        }
        $this->locale = $locale;
        return $this;
    }
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 '/';
    }
1193885
public function setLocale(string $locale): self
	{
		if ($locale === '') {
			$this->locale = $locale;
		} else {
			if (!\Locale::parseLocale($locale)) {
				throw new \InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
			}
			$this->locale = \Locale::canonicalize($locale);
		}

		$this->setOptions['locale'] = null;

		return $this;
	}
656030
private function hasLocale(string $locale): bool
    {
        assert(empty($locale) === false);

        $result = in_array($locale, $this->getLocales());

        return $result;
    }
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
        ]);
    }
177078
public function getRouteLocalePrefix($locale = null) {
        if (is_null($locale)) {
            $locale = $this->getLocaleFromRoute();
        }
        return $this->getDefaultRoutelocale() === $locale ? ($this->isUsePrefixForDefaultLocale() ? $locale : '') : $locale;
    }
826476
protected function getLocale($locale)
    {
        $result = null;
        if ($locale instanceof LocaleEntity) {
            $result = $locale;
        } elseif (is_string($locale) && $locale !== '') {
            $result = $this->app->make(LocaleRepository::class)->findApproved($locale);
        }

        return $result;
    }
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);
    }
879532
public function language($locale = null)
    {
        if ($locale !== null) {
            $this->language = $locale;
        }

        return $this->language;
    }
1168948
public function findAllByLocale($locale)
    {
        try {
            $qb = $this->getStatusQuery($locale);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
940480
public function getLangByLocale($locale)
    {
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());

        // Sending service start event
        $arrayParameters = $this->sendEvent('melisengine_service_get_lang_by_local_start', $arrayParameters);

        // Service implementation start
        $langTable = $this->getServiceLocator()->get('MelisEngineTableCmsLang');
        $result = $langTable->getEntryByField('lang_cms_locale', $locale)->toArray();
        if(!isset($result[0]['lang_cms_locale'])) return null;
        $result = $result[0];
        // Service implementation end

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $result;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melisengine_service_get_lang_by_local_end', $arrayParameters);

        return $arrayParameters['results'];
    }