protected function getRedirectionUrl(Request $request)
{
$locale = $request->segment(1, null);
if ($this->getSupportedLocales()->has($locale)) {
return $this->isDefaultLocaleHidden($locale) ? localization()->getNonLocalizedURL() : false;
}
// If the current url does not contain any locale
// The system redirect the user to the very same url "localized" we use the current locale to redirect him
if ($this->getCurrentLocale() !== $this->getDefaultLocale() || !$this->hideDefaultLocaleInURL()) {
return localization()->getLocalizedURL(session('locale'), $request->fullUrl());
}
return false;
}