© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
5 replies
Takács Gábor

Page translatable

What I’m trying to do:
Make a custom Filament v3
Page
Page
translatable using spatie/laravel-translatable. I want the user to switch languages and edit localized values.

What I did:
- My
Setting
Setting
model uses
HasTranslations
HasTranslations
and stores JSON values correctly.
- My
Page
Page
uses
Translatable
Translatable
trait.
- Locale switcher appears via
Actions\LocaleSwitcher::make()
Actions\LocaleSwitcher::make()
.
- The form has inputs like
TextInput::make('html_title')
TextInput::make('html_title')
,
RichEditor::make('footer_descript')
RichEditor::make('footer_descript')
, etc.

The issue:
Switching the language via the locale switcher does not change the form input values.
Everything stays in the default locale. No errors in console or logs.
Expected: When switching to e.g.
en
en
, the form should load
html_title
html_title
and others in English.

Code snippet:

class Settings extends Page implements HasForms
{
    use InteractsWithForms, Translatable;

    public ?array $data = [];

    public function mount(): void
    {
        $this->form->fill([
            'html_title' => Setting::get('html_title'),
            'footer_descript' => Setting::get('footer_descript'),
        ]);
    }

    public function form(Form $form): Form
    {
        return $form
            ->statePath('data')
            ->schema([
                TextInput::make('html_title')->label('HTML title'),
                RichEditor::make('footer_descript')->label('Footer'),
            ]);
    }

    public function save(): void
    {
        foreach ($this->form->getState() as $key => $value) {
            Setting::updateOrCreate(['key' => $key], ['value' => $value]);
        }
    }

    protected function getHeaderActions(): array
    {
        return [ Actions\LocaleSwitcher::make() ];
    }
}
class Settings extends Page implements HasForms
{
    use InteractsWithForms, Translatable;

    public ?array $data = [];

    public function mount(): void
    {
        $this->form->fill([
            'html_title' => Setting::get('html_title'),
            'footer_descript' => Setting::get('footer_descript'),
        ]);
    }

    public function form(Form $form): Form
    {
        return $form
            ->statePath('data')
            ->schema([
                TextInput::make('html_title')->label('HTML title'),
                RichEditor::make('footer_descript')->label('Footer'),
            ]);
    }

    public function save(): void
    {
        foreach ($this->form->getState() as $key => $value) {
            Setting::updateOrCreate(['key' => $key], ['value' => $value]);
        }
    }

    protected function getHeaderActions(): array
    {
        return [ Actions\LocaleSwitcher::make() ];
    }
}


Note:
This is a custom
Page
Page
, not a
Resource
Resource
.
Model translation works fine outside Filament.
But in this
Page
Page
form, switching language doesn’t affect input values.

Any ideas what I’m missing?
Thanks!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Admin Page translatable?
FilamentFFilament / ❓┊help
3y ago
spatie translatable on custom page
FilamentFFilament / ❓┊help
12mo ago
Custom page and spatie translatable
FilamentFFilament / ❓┊help
3y ago
Use Spatie Translatable in Tenant Profile Page
FilamentFFilament / ❓┊help
3y ago