F
Filament5mo 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
toeknee5mo 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
akshOP5mo ago
I have defined labels and groups like this, but it is not working.
Solution
awcodes
awcodes5mo ago
try it with a callback instead
->group(fn () => __('sidebar.Booking'))
->group(fn () => __('sidebar.Booking'))
aksh
akshOP5mo ago
Thank you, sir. It's working.
Want results from more Discord servers?
Add your server