Closed jobara closed 1 year ago
Hey @jobara,
Sorry for the late response. I've totally missed the notification here. I'll have a look at this this week. 😄
@jobara I've fixed this in https://github.com/chinleung/laravel-multilingual-routes/releases/tag/v4.0.1. 😄
Let's say you have something like this:
// routes/web.php
Route::prefix('prefix')->group(function () {
Route::multilingual('test', function () {
return 'Hello World';
});
});
You can now translate the grouped prefix like this:
// lang/fr/routes.php
return [
'prefix/test' => 'prefixe/teste',
];
@chinleung thank you so much for the fix and new release!
Describe the bug
The URI isn't properly localized when a the routes are use a prefix defined in a group. The outputted routes will use the unlocalized URI
To Reproduce Say you define a route such as:
And have a French translation file at
resources/lang/fr/routes.php
with something like:The routes available are:
test/route
fr/test/route
Expected behavior
The route should be localized based on the translation file. With the above sample one would expect the following routes.
test/route
fr/teste/french-route
Additional context
If the routes are defined without the prefix and group they are localized correctly. e.g.: