mcamara / laravel-localization

Easy localization for Laravel
MIT License
3.38k stars 515 forks source link

prefix for locales #721

Closed dissalow closed 4 years ago

dissalow commented 4 years ago

Site works on subfolder and all routes need to bee done like this https://example.com/info/en. All routes allready in groupe with prefix: Route::group( [ 'prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath' ] ], function() { //code } ); Allways redirect like https://example.com/en/info/. Groupe with prefix /info/ and 'prefix' => '\/info/' . LaravelLocalization::setLocale(), not working.

iwasherefirst2 commented 4 years ago

This packages only works when the prefix is set as first parameter in url, see: https://github.com/mcamara/laravel-localization/issues/382

If you want to add this feature to the package, PR are welcome.