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
@@ -53,12 +53,12 @@ class CallResource extends Resource
->schema([
Forms\Components\DateTimePicker::make('called_at')->label(__('Data & ora'))->default(now())->required(),
Forms\Components\Select::make('direction')
->options(Call::DIRECTIONS)
->options(\App\Support\I18n::opts(Call::DIRECTIONS))
->default('incoming')
->required(),
Forms\Components\TextInput::make('phone')->label(__('Telefon'))->tel()->required()->maxLength(40),
Forms\Components\Select::make('status')
->options(Call::STATUSES)
->options(\App\Support\I18n::opts(Call::STATUSES))
->default('answered')
->required(),
Forms\Components\TextInput::make('duration_sec')->label(__('Durată (sec)'))->numeric()->default(0),
@@ -92,7 +92,7 @@ class CallResource extends Resource
->badge(),
])
->filters([
Tables\Filters\SelectFilter::make('direction')->options(Call::DIRECTIONS),
Tables\Filters\SelectFilter::make('direction')->options(\App\Support\I18n::opts(Call::DIRECTIONS)),
Tables\Filters\Filter::make('today')
->label(__('Astăzi'))
->query(fn ($q) => $q->whereDate('called_at', today())),