Skip to content

Commit 74c11f0

Browse files
Merge pull request #99 from CodeWithDennis/feature/add-translatable-components-back
feat: Add translatable components support
2 parents bf13484 + bd9731d commit 74c11f0

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

app/Providers/AppServiceProvider.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
namespace App\Providers;
66

7+
use Filament\Forms\Components\Field;
8+
use Filament\Forms\Components\Placeholder;
9+
use Filament\Infolists\Components\Entry;
10+
use Filament\Support\Components\Component;
11+
use Filament\Support\Concerns\Configurable;
12+
use Filament\Tables\Columns\Column;
13+
use Filament\Tables\Filters\BaseFilter;
714
use Filament\Tables\Table;
815
use Illuminate\Support\ServiceProvider;
916

@@ -17,6 +24,18 @@ public function register(): void
1724
public function boot(): void
1825
{
1926
$this->configureTable();
27+
$this->translatableComponents();
28+
}
29+
30+
private function translatableComponents(): void
31+
{
32+
foreach ([Field::class, BaseFilter::class, Placeholder::class, Column::class, Entry::class] as $component) {
33+
/* @var Configurable $component */
34+
$component::configureUsing(function (Component $translatable): void {
35+
/** @phpstan-ignore method.notFound */
36+
$translatable->translateLabel();
37+
});
38+
}
2039
}
2140

2241
private function configureTable(): void

0 commit comments

Comments
 (0)