FilamentF
Filamentβ€’2y ago
Chris

Always translate all labels?

Is there a way to always translate all labels? I keep adding ->translateLabel() to everything but i am thinking there must be an easier way to do this. πŸ‘‹ to @Povilas K and #filament-daily πŸ˜„

Maybe this question will end up there!? ❀️
Solution
I think you can use this

use Filament\Forms\Components\Field;
use Filament\Tables\Columns\Column;
...

return $panel
    ->bootUsing(function () {

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


or in the AppServiceProvider
Was this page helpful?