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:
2026-07-16 06:42:16 +00:00
parent 272080b274
commit 95aeecb932
33 changed files with 159 additions and 123 deletions
@@ -69,7 +69,7 @@ class LeadResource extends Resource
Forms\Components\TextInput::make('phone')->label(__('Telefon'))->tel()->required()->maxLength(40),
Forms\Components\TextInput::make('email')->email()->maxLength(120),
Forms\Components\Select::make('status')
->options(Lead::STATUSES)
->options(\App\Support\I18n::opts(Lead::STATUSES))
->default('new')
->required(),
]),
@@ -84,7 +84,7 @@ class LeadResource extends Resource
->columns(2)
->schema([
Forms\Components\Select::make('source')
->options(Lead::SOURCES)
->options(\App\Support\I18n::opts(Lead::SOURCES))
->searchable()
->default('manual'),
Forms\Components\Select::make('assigned_to')
@@ -115,9 +115,9 @@ class LeadResource extends Resource
Tables\Columns\TextColumn::make('name')->searchable()->sortable(),
Tables\Columns\TextColumn::make('phone')->copyable()->searchable(),
Tables\Columns\TextColumn::make('car')->label(__('Auto'))->formatStateUsing(fn ($state, $record) => trim($state . ' ' . ($record->model ?? ''))),
Tables\Columns\TextColumn::make('source')->label(__('Sursă'))->formatStateUsing(fn ($state) => Lead::SOURCES[$state] ?? $state)->badge(),
Tables\Columns\TextColumn::make('source')->label(__('Sursă'))->formatStateUsing(fn ($state) => __(Lead::SOURCES[$state] ?? $state))->badge(),
Tables\Columns\TextColumn::make('status')
->formatStateUsing(fn ($state) => Lead::STATUSES[$state] ?? $state)
->formatStateUsing(fn ($state) => __(Lead::STATUSES[$state] ?? $state))
->badge()
->colors([
'gray' => ['new'],
@@ -130,8 +130,8 @@ class LeadResource extends Resource
Tables\Columns\TextColumn::make('budget')->money('MDL')->placeholder('—'),
])
->filters([
Tables\Filters\SelectFilter::make('status')->options(Lead::STATUSES),
Tables\Filters\SelectFilter::make('source')->options(Lead::SOURCES),
Tables\Filters\SelectFilter::make('status')->options(\App\Support\I18n::opts(Lead::STATUSES)),
Tables\Filters\SelectFilter::make('source')->options(\App\Support\I18n::opts(Lead::SOURCES)),
])
->actions([
Actions\Action::make('convert')