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
@@ -75,7 +75,7 @@ class SubscriptionResource extends Resource
$set('currency', $plan->currency);
}),
Forms\Components\Select::make('period')
->options(Subscription::PERIODS)->default('monthly')->required()->live()
->options(\App\Support\I18n::opts(Subscription::PERIODS))->default('monthly')->required()->live()
->afterStateUpdated(function ($state, Set $set, Get $get) {
$plan = Plan::find($get('plan_id'));
if (! $plan) return;
@@ -88,7 +88,7 @@ class SubscriptionResource extends Resource
$set('period_end', $end);
}),
Forms\Components\Select::make('status')
->options(Subscription::STATUSES)->default('pending')->required(),
->options(\App\Support\I18n::opts(Subscription::STATUSES))->default('pending')->required(),
]),
Schemas\Components\Section::make(__('Sumă'))
->columns(3)
@@ -96,7 +96,7 @@ class SubscriptionResource extends Resource
Forms\Components\TextInput::make('amount')->numeric()->required()->suffix(fn (Get $get) => $get('currency') ?? 'MDL'),
Forms\Components\Select::make('currency')->options(['MDL' => 'MDL', 'EUR' => 'EUR', 'USD' => 'USD'])->default('MDL'),
Forms\Components\Select::make('payment_method')
->options(Subscription::PAYMENT_METHODS),
->options(\App\Support\I18n::opts(Subscription::PAYMENT_METHODS)),
]),
Schemas\Components\Section::make(__('Perioadă'))
->columns(3)
@@ -151,8 +151,8 @@ class SubscriptionResource extends Resource
Tables\Columns\TextColumn::make('paid_at')->label(__('Plătit'))->date()->placeholder('—'),
])
->filters([
Tables\Filters\SelectFilter::make('status')->options(Subscription::STATUSES),
Tables\Filters\SelectFilter::make('period')->options(Subscription::PERIODS),
Tables\Filters\SelectFilter::make('status')->options(\App\Support\I18n::opts(Subscription::STATUSES)),
Tables\Filters\SelectFilter::make('period')->options(\App\Support\I18n::opts(Subscription::PERIODS)),
])
->actions([
Actions\Action::make('mark_paid')