How to set a language for Filament?
I want to have French for normal Laravel frontend and then English for admin which is in Filament.
In app.php I have set locale to French but French is then also in Filament.
How to set up English for Filament admin? Because right now everything is in French, including Filament admin.
Solution:Jump to solution
I would probably make a middleware that checks if it's a filament route then do
app()->setLocale('en')
to force it.2 Replies
Solution
I would probably make a middleware that checks if it's a filament route then do
app()->setLocale('en')
to force it.Interesting. Thanks. I ended up with https://filamentphp.com/plugins/bezhansalleh-language-switch for now. It seems to remember my choice and is not too distractive in the top bar - could be even useful to be able to effortlessly switch languages even in admin in certain situation in the future. But your solution and checking /admin/* etc. and forcing setLocale('en') is probably the way to go.