F
Filament6d ago
aksh

Translate is not working on only NavigationItem in AdminpanelProvider

->navigationItems( [ NavigationItem::make('Booking List') ->label( ('sidebar.Booking List') ) ->url( fn (): string => Dashboard::getUrl().'/bookings/listing' ) ->icon( 'heroicon-o-presentation-chart-line' ) ->activeIcon( 'heroicon-s-presentation-chart-line' ) ->isActiveWhen( fn (): bool => Str::contains( url()->current(), 'bookings/listing' ) ) ->group( ('sidebar.Booking') ) ->sort( 3 ) ->visible(fn(): bool => Auth::user()?->can('Booking Read')), how to fix this issue?I used language switcher plugin
Solution:
try it with a callback instead
->group(fn () => __('sidebar.Booking'))
->group(fn () => __('sidebar.Booking'))
...
Jump to solution
4 Replies
toeknee
toeknee6d ago
->group( __('sidebar.Booking') )
->label( __('sidebar.Booking List') )
->group( __('sidebar.Booking') )
->label( __('sidebar.Booking List') )
Fair sure it should be as per the above...
aksh
aksh6d ago
I have defined labels and groups like this, but it is not working.
Solution
awcodes
awcodes6d ago
try it with a callback instead
->group(fn () => __('sidebar.Booking'))
->group(fn () => __('sidebar.Booking'))
aksh
aksh6d ago
Thank you, sir. It's working.
Want results from more Discord servers?
Add your server
More Posts