laravel-localization
laravel-localization copied to clipboard
Switching languages in sub route does not change nasted paths
When switching languages the route does not update the translated path in the url:
Route::prefix(LaravelLocalization::setLocale())
->middleware(['localize', 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath'])
->group(function () {
Route::prefix(LaravelLocalization::transRoute('exercises.route'))
->group(function () {
Route::get('/', ExerciseOverviewController::class)->name('exercises');
Route::get('{exercise}', ExerciseDetailController::class)->name('exercise.detail');
});
});
So when I'm on https://platform.lokal.host/en/exercises/1
and I switch to NL for example it does this https://platform.lokal.host/nl/exercises/1
instead of https://platform.lokal.host/nl/oefeningen/1