I can't figure out why LaravelLocalization cannot translate the routes which I'm declaring in routes.php (Modules/ModuleName/Http/routes.php) file of a module which I create with nwidart laravel-modules package for laravel, 'localize' (\Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes::class) middleware is also present in the app's Kernel.php and in the route group as stated in here. The route is not translated and appears as /en/booking::all.companies.index instead of /en/companies (or /ru/kompanii):
Route::group(
[
'prefix' => LaravelLocalization::setLocale(),
'middleware' => ['web', 'auth', 'localize', 'optimizeImages'],
'namespace' => 'Modules\Booking\Http\Controllers',
],
function() {
Route::get(LaravelLocalization::transRoute('booking::all.companies.index'), 'CompanyController@index')->name('booking.companies.index');
});
but when module namespace prefix "booking::" is removed from translation string (LaravelLocalization::transRoute('all.companies.index') instead of LaravelLocalization::transRoute('booking::all.companies.index')) it CAN translate the route.
Please help me to resolve the issue, thanks.
(My installation if it helps: Laravel Framework 5.5.43, "mcamara/laravel-localization": "1.3", "nwidart/laravel-modules": "2.7". No other localization package is installed besides mcamara/laravel-localization)