You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered the same problem. Parameter hideDefaultLocaleInURL does not work if a localeMapping list is used.
Also your fix doesn't work. $orgLocale will never equal $shortFormLocale.
I modified the isHiddenDefault function to take into account localeMapping
# src/vendor/mcamara/laravel-localization/src/Mcamara/LaravelLocalization/LaravelLocalization.php:217
public function isHiddenDefault($locale)
{
return ($this->getDefaultLocale() === $this->getInversedLocaleFromMapping($locale) && $this->hideDefaultLocaleInURL());
}
Describe the bug
The LaravelLocalizationRedirectFilter::class middleware ignores config.laravellocalization.localesMapping if the mapping exists.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The locale in url should be extracted.
More info:
supportedLocales
,useAcceptLanguageHeader
andhideDefaultLocaleInURL
).Additional context
src/vendor/mcamara/laravel-localization/src/Mcamara/LaravelLocalization/Middleware/LaravelLocalizationRedirectFilter.php:31
Add the following Code:
It should be fixed after that.
The text was updated successfully, but these errors were encountered: