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 assume I have done something wrong somewhere but...
New Laravel 8 sail install
Installed laravel-localization over composer.
Created a localesMapping 'localesMapping' => [ 'en-GB' => 'uk', 'de-DE' => 'de' ],
Redirect not working, 'en' ok, 'de' is a 404
Routing in web is set up so Route::group( [ 'prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'localize','localeSessionRedirect', 'localizationRedirect', 'localeViewPath' ] ], function() {
After looking into this I find in vendor/mcamara/laravel-localization/src/Mcamara/LaravelLocalization/LaravelLocalization.php the following.
When calling LaravelLocalization::setLocale(),
I get from $locale = $this->request->segment(1);
"de" as expected
but then $locale = $this->getInversedLocaleFromMapping($locale);
"de_DE"
And the next part goes wrrong $this->supportedLocales
array:2 [▼
"de" => array:4 [▶]
"en" => array:4 [▶]
]
where obviously de_DE is not found.
If I just comment out getInversedLocaleFromMapping then all works fine.
What have I done wrong?
thanks
The text was updated successfully, but these errors were encountered:
I assume I have done something wrong somewhere but...
New Laravel 8 sail install
Installed laravel-localization over composer.
Created a localesMapping
'localesMapping' => [ 'en-GB' => 'uk', 'de-DE' => 'de' ],
Redirect not working, 'en' ok, 'de' is a 404
Routing in web is set up so
Route::group( [ 'prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'localize','localeSessionRedirect', 'localizationRedirect', 'localeViewPath' ] ], function() {
After looking into this I find in vendor/mcamara/laravel-localization/src/Mcamara/LaravelLocalization/LaravelLocalization.php the following.
When calling LaravelLocalization::setLocale(),
I get from
$locale = $this->request->segment(1);
"de" as expected
but then
$locale = $this->getInversedLocaleFromMapping($locale);
"de_DE"
And the next part goes wrrong
$this->supportedLocales
array:2 [▼
"de" => array:4 [▶]
"en" => array:4 [▶]
]
where obviously de_DE is not found.
If I just comment out getInversedLocaleFromMapping then all works fine.
What have I done wrong?
thanks
The text was updated successfully, but these errors were encountered: