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
@@ -57,7 +57,7 @@ class PartsRelationManager extends RelationManager
Forms\Components\TextInput::make('sell_price')->label(__('Preț vânzare'))->numeric()->required(),
Forms\Components\TextInput::make('discount_pct')->label(__('Discount %'))->numeric()->default(0),
Forms\Components\Select::make('status')
->options(WorkOrderPart::STATUSES)
->options(\App\Support\I18n::opts(WorkOrderPart::STATUSES))
->default('needed')
->required()
->helperText(__('La trecere pe „Montată" se scade automat din stoc.')),
@@ -27,7 +27,7 @@ class PaymentsRelationManager extends RelationManager
Forms\Components\DatePicker::make('paid_at')->label(__('Data'))->default(today())->required(),
Forms\Components\TextInput::make('amount')->label(__('Sumă'))->numeric()->required(),
Forms\Components\Select::make('method')
->options(Payment::METHODS)
->options(\App\Support\I18n::opts(Payment::METHODS))
->default('cash')
->required(),
Forms\Components\TextInput::make('reference')->label(__('Referință'))->maxLength(64),
@@ -32,9 +32,9 @@ class SubcontractJobsRelationManager extends RelationManager
->columnSpanFull(),
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\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\Textarea::make('description')->label(__('Descriere'))->rows(2)->columnSpanFull(),
Forms\Components\TextInput::make('cost')->label(__('Cost (terț)'))->numeric()->default(0)->required(),
Forms\Components\TextInput::make('markup_pct')->label(__('Markup %'))->numeric()->default(0),
@@ -51,7 +51,7 @@ class WorksRelationManager extends RelationManager
->options(fn () => User::pluck('name', 'id'))
->searchable(),
Forms\Components\Select::make('status')
->options(WorkOrderWork::STATUSES)
->options(\App\Support\I18n::opts(WorkOrderWork::STATUSES))
->default('todo')
->required(),
Forms\Components\Textarea::make('notes')->label(__('Notițe'))->columnSpanFull()->rows(2),