Make settings translatable
Hi everyone!
I'm struggling to make my settings translatable.
I currently use:
To be perfectly clear, what I want is to let users translate themselves the dynamic strings in the settings page.
E.g. you have a setting named "Hero title".
How do I let users have multilingual content in it?
Thanks for your help!
I'm struggling to make my settings translatable.
I currently use:
- Filament v4
- larazeus/spatie-translatable
- rawilk/laravel-settings
To be perfectly clear, what I want is to let users translate themselves the dynamic strings in the settings page.
E.g. you have a setting named "Hero title".
How do I let users have multilingual content in it?
Thanks for your help!
Solution
The Spatie Translatable package handles the logic for setting/getting the translatable values. If that package doesn't work with attributes, you can't use that and need to roll your own solution.
Maybe you can use it's "Context" feature:
https://randallwilk.dev/docs/laravel-settings/v3/basic-usage/contextual-settings
Maybe you can use it's "Context" feature:
https://randallwilk.dev/docs/laravel-settings/v3/basic-usage/contextual-settings
