Translate the modal

I want to translate the message 'Please fill out this field`
use Filament\Tables\Actions\Action;
use Filament\Forms\Components\Textarea;

Action::make(name: 'action')
->label(label: __(key: 'filament/user.label'))
->form(form: [
Textarea::make(name: 'field')
->label(label: __(key: 'filament/user.description'))
->maxLength(length: 10_000)
->required(),
])
->validationMessages(messages: [
'required' => __(key: 'filament/user.description_required'),
])
->successNotificationTitle(title: __(key: 'filament/user.notifications.success'))
use Filament\Tables\Actions\Action;
use Filament\Forms\Components\Textarea;

Action::make(name: 'action')
->label(label: __(key: 'filament/user.label'))
->form(form: [
Textarea::make(name: 'field')
->label(label: __(key: 'filament/user.description'))
->maxLength(length: 10_000)
->required(),
])
->validationMessages(messages: [
'required' => __(key: 'filament/user.description_required'),
])
->successNotificationTitle(title: __(key: 'filament/user.notifications.success'))
where can I find this translation in Textarea in Modal I tried to find translations after publishing translations https://filamentphp.com/docs/3.x/panels/installation#publishing-translations, but I can not find matched value for this.
No description
Solution:
```php ->extraInputAttributes([ 'oninvalid' => 'this.setCustomValidity('Custom title')', 'oninput' => 'this.setCustomValidity('')', ])...
Jump to solution
7 Replies
LeandroFerreira
this is a validation message for html form.. Maybe this can help you https://discord.com/channels/883083792112300104/1270286883389440020/1270302641561534516
Paweł Wawrzyniak
Thanks, this is a very good tip 🙂
LeandroFerreira
did it work?
Paweł Wawrzyniak
not yet I tried ->extraAttributes(attributes: ['title' => 'Text input']) but still trying
Solution
LeandroFerreira
->extraInputAttributes([
'oninvalid' => 'this.setCustomValidity(\'Custom title\')',
'oninput' => 'this.setCustomValidity(\'\')',
])
->extraInputAttributes([
'oninvalid' => 'this.setCustomValidity(\'Custom title\')',
'oninput' => 'this.setCustomValidity(\'\')',
])
Paweł Wawrzyniak
Now it work perfectly. Thank's a lot.
Paweł Wawrzyniak
Is it possible to set a value from validation.php instead of putting a hardcoded string each time? If I use ->rules(['required') then I will get the value from validation.php file, but struggle to find a solution when validation is in HTML5
Want results from more Discord servers?
Add your server