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:
@@ -48,8 +48,8 @@ class BodyshopJobResource extends Resource
|
||||
->columns(3)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('number')->label(__('Nr.'))->disabled()->dehydrated(false)->placeholder(__('Generat automat')),
|
||||
Forms\Components\Select::make('type')->label(__('Tip'))->options(BodyshopJob::TYPES)->default('body_repair')->required(),
|
||||
Forms\Components\Select::make('status')->label(__('Status'))->options(BodyshopJob::STATUSES)->default('estimate')->required(),
|
||||
Forms\Components\Select::make('type')->label(__('Tip'))->options(\App\Support\I18n::opts(BodyshopJob::TYPES))->default('body_repair')->required(),
|
||||
Forms\Components\Select::make('status')->label(__('Status'))->options(\App\Support\I18n::opts(BodyshopJob::STATUSES))->default('estimate')->required(),
|
||||
Forms\Components\Select::make('client_id')
|
||||
->label(__('Client'))
|
||||
->options(fn () => Client::pluck('name', 'id'))
|
||||
@@ -76,7 +76,7 @@ class BodyshopJobResource extends Resource
|
||||
Forms\Components\TextInput::make('claim_no')->label(__('Nr. dosar daună'))
|
||||
->visible(fn (Get $get) => $get('is_insurance')),
|
||||
Forms\Components\Select::make('insurance_status')->label(__('Status dosar'))
|
||||
->options(BodyshopJob::INSURANCE_STATUSES)
|
||||
->options(\App\Support\I18n::opts(BodyshopJob::INSURANCE_STATUSES))
|
||||
->visible(fn (Get $get) => $get('is_insurance')),
|
||||
]),
|
||||
Schemas\Components\Section::make(__('Foto înainte / după'))
|
||||
@@ -115,8 +115,8 @@ class BodyshopJobResource extends Resource
|
||||
]),
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('type')->options(BodyshopJob::TYPES),
|
||||
Tables\Filters\SelectFilter::make('status')->options(BodyshopJob::STATUSES),
|
||||
Tables\Filters\SelectFilter::make('type')->options(\App\Support\I18n::opts(BodyshopJob::TYPES)),
|
||||
Tables\Filters\SelectFilter::make('status')->options(\App\Support\I18n::opts(BodyshopJob::STATUSES)),
|
||||
Tables\Filters\TernaryFilter::make('is_insurance')->label(__('Caz asigurare')),
|
||||
])
|
||||
->actions([
|
||||
|
||||
Reference in New Issue
Block a user