FilamentF
Filament17mo ago
Tieme

Apply ->translateLabel() everywhere

Hi All,

Is it possible to apply ->translateLabel() on every Entry/Column in Forms, Tabel and Infolist?
I need to translate everything but don't want to add the field manual.

I thought of overwriting the Trait and set the Boolean protected bool $shouldTranslateLabel = false; to true. But what i know it is not possible to overwrite Traits like Classes in Laravel.

Any help would be appreciated.

Thanks
Solution
yes, use configureUsing in your provider

Field::configureUsing(function (Field $field) {
    $field->translateLabel();
});

Column::configureUsing(function (Column $column) {
    $column->translateLabel();
});

Entry::configureUsing(function (Entry $entry) {
    $entry->translateLabel();
});
Was this page helpful?