i18n: fix widget heading, translate Select options from model consts, +40 keys
- LowStockTable: rename getHeading → getTableHeading (correct Filament API) - Global I18n::opts() helper wraps Model::CONST values in __() so Select dropdowns show translated status/type/season/etc. labels - Sed-transform ->options(X::CONST), ->options(array_combine(X::A,X::A)), and formatStateUsing(fn($s)=>X::CONST[$s]??$s) → wrap with __() (58 options + 10 combines + 7 formatStateUsing across 28 files) - CalendarBoard: all 7 day names now via __() (was missing 4) - calendar-board.blade: fix untranslated 'săptămâna curentă', 'capacitate', 'rata confirmare', 'mediu', 'plin', 'Pod / Zi' / 'Mecanic / Zi' - +40 RU/EN translations (Client & Auto, Maistru / Mecanic, Programat, Sosit, Finalizat, Anulat, Neprezentat, days of week, calendar KPIs) All 306 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@ class AppointmentResource extends Resource
|
||||
->options(fn () => User::pluck('name', 'id'))
|
||||
->searchable(),
|
||||
Forms\Components\Select::make('status')
|
||||
->options(Appointment::STATUSES)
|
||||
->options(\App\Support\I18n::opts(Appointment::STATUSES))
|
||||
->default('scheduled')
|
||||
->required(),
|
||||
]),
|
||||
@@ -103,7 +103,7 @@ class AppointmentResource extends Resource
|
||||
Tables\Columns\TextColumn::make('vehicle.plate')->label(__('Auto'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('master.name')->label(__('Maistru'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->formatStateUsing(fn ($state) => Appointment::STATUSES[$state] ?? $state)
|
||||
->formatStateUsing(fn ($state) => __(Appointment::STATUSES[$state] ?? $state))
|
||||
->badge()
|
||||
->colors([
|
||||
'gray' => ['scheduled'],
|
||||
@@ -119,7 +119,7 @@ class AppointmentResource extends Resource
|
||||
Tables\Filters\Filter::make('upcoming')
|
||||
->label(__('Viitoare'))
|
||||
->query(fn ($q) => $q->where('date', '>=', today())),
|
||||
Tables\Filters\SelectFilter::make('status')->options(Appointment::STATUSES),
|
||||
Tables\Filters\SelectFilter::make('status')->options(\App\Support\I18n::opts(Appointment::STATUSES)),
|
||||
Tables\Filters\SelectFilter::make('post_id')
|
||||
->label(__('Pod'))
|
||||
->options(fn () => Post::pluck('name', 'id')),
|
||||
|
||||
Reference in New Issue
Block a user