order navigation group with multi languages
it works with English only
do I have to add them in each language?
15 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Thanks, but I'm using it inside
Filament::serving()
but I'm using custom service provider FilamentServiceProvider
and I registered it in config/app.php
and it already working on English language, but not on others.
I'll try to move it in AppServiceProvider and see
I moved it in appServiceProvider and still works on English onlyhere is the position on English (look at cart icon) and after changing language it changes to the default order
Here is my boot method
so for this case i would reccomend a different approach
navigation items should have an english group name as an “id” for that group
and then in the service provider, you can map the IDs to translated labels
when you register the nav groups… ‘offers’ => NavigationGroup::make()->label(__(‘Offers’))
thanks Dan, this is a better approach and works fine
sorry Dan, I didn't notice that translation doesn't work by that approach.
am I missing something?
wdym by translation doesnt work?
the navigation group show like that
messages.abouts
sorry I mean it's always in english@Dan Harrin sorry for that
where are you setting the locale
Filament
Language Switch by Bezhan Salleh - Plugins - Filament
Zero config Language Switch(Changer/Localizer) plugin for Filamentphp Admin
app()->getLocale()
returns the right language, ar
for arabic and en
for english
oh app()->getLocale()
inside the boot method return en
all the time
I'm using filament languages switcher plugintry adding
BezhanSalleh\FilamentLanguageSwitch\Http\Middleware\SwitchLanguageLocale
to the middleware array in config
make sure it goes before the DispatchServingFilamentEventthat works, thank you