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:
@@ -45,7 +45,7 @@ class SubcontractJobResource extends Resource
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('number')->label(__('Nr.'))->disabled()->dehydrated(false)->placeholder(__('Generat automat')),
|
||||
Forms\Components\Select::make('status')->options(SubcontractJob::STATUSES)->default('sent')->required(),
|
||||
Forms\Components\Select::make('status')->options(\App\Support\I18n::opts(SubcontractJob::STATUSES))->default('sent')->required(),
|
||||
Forms\Components\Select::make('subcontractor_id')
|
||||
->label(__('Subcontractor'))
|
||||
->options(fn () => Subcontractor::where('is_active', true)->pluck('name', 'id'))
|
||||
@@ -57,7 +57,7 @@ class SubcontractJobResource extends Resource
|
||||
->searchable(),
|
||||
Forms\Components\Select::make('category')
|
||||
->label(__('Categorie'))
|
||||
->options(array_combine(Subcontractor::SPECIALTIES, Subcontractor::SPECIALTIES))
|
||||
->options(\App\Support\I18n::opts(array_combine(Subcontractor::SPECIALTIES, Subcontractor::SPECIALTIES)))
|
||||
->searchable(),
|
||||
Forms\Components\Textarea::make('description')->label(__('Descriere'))->rows(2)->columnSpanFull(),
|
||||
]),
|
||||
@@ -109,7 +109,7 @@ class SubcontractJobResource extends Resource
|
||||
Tables\Columns\IconColumn::make('paid_to_sub')->label(__('Plătit terț'))->boolean()->toggleable(),
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('status')->options(SubcontractJob::STATUSES),
|
||||
Tables\Filters\SelectFilter::make('status')->options(\App\Support\I18n::opts(SubcontractJob::STATUSES)),
|
||||
Tables\Filters\SelectFilter::make('subcontractor_id')
|
||||
->label(__('Subcontractor'))
|
||||
->options(fn () => Subcontractor::pluck('name', 'id')),
|
||||
|
||||
Reference in New Issue
Block a user