translate routes in custom plugin

in my custom plugin, i have the web.php file for the routes
Route::group(['middleware' => ['web']], function () {
    Route::get('/people', [TeamController::class, 'index'])->name('team.index');
    Route::get('/people/{slug}', [MemberController::class, 'show'])->name('people.show');
    Route::get('/people/c/{slug?}', [TeamController::class, 'index'])->name('team.show');
});

i would like to translate people when i choose another language, for example en: people it: persone
i've tried

Route::get(__('polipeople::messages.team'), [TeamController::class, 'index'])->name('team.index');

but i get
Target class [translator] does not exist.

because Laravel is trying to resolve the __() function before the service container is fully initialized, causing the error 'Target class [translator] does not exist.'

any solution or method for this?
thanks
Was this page helpful?