laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

Switching languages in sub route does not change nasted paths

Open NoahNxT opened this issue 1 year ago • 0 comments

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

NoahNxT avatar Jun 08 '23 14:06 NoahNxT