i18n: wrap all formatStateUsing(fn(\$s)=>X::CONST[\$s]??\$s) with __() (21 files)

Previous sed pass only matched \$state; missed \$s and other arg-name
variants. This time the regex is arg-name-agnostic and touches 21
files across Filament resources & relation managers.

Also wraps two special cases: UserResource role-labels lookup and
LaborResource pricing_mode ternary ('Fix' | 'Pe oră').

+27 human translations for the enum values that were still identity
fallback: WorkOrderWork.STATUSES (De făcut), Purchase.STATUSES,
OnlineOrder.STATUSES, Call.DIRECTIONS/STATUSES, BodyshopJob.TYPES/
STATUSES, TireSet.SEASONS, MessageTemplate.CHANNELS,
DamagePoint.SEVERITIES, ServiceTemplateItem.KINDS.

All 306 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 07:41:35 +00:00
parent e4e63a3a09
commit e969bb9c7d
25 changed files with 78 additions and 40 deletions
@@ -77,7 +77,7 @@ class CallResource extends Resource
->columns([
Tables\Columns\TextColumn::make('called_at')->label(__('Data'))->dateTime('d.m.Y H:i')->sortable(),
Tables\Columns\TextColumn::make('direction')
->formatStateUsing(fn ($s) => Call::DIRECTIONS[$s] ?? $s)
->formatStateUsing(fn ($s) => __(Call::DIRECTIONS[$s] ?? $s))
->badge()
->colors([
'success' => ['incoming'],
@@ -88,7 +88,7 @@ class CallResource extends Resource
Tables\Columns\TextColumn::make('client.name')->label(__('Client'))->placeholder('—'),
Tables\Columns\TextColumn::make('duration_formatted')->label(__('Durată'))->state(fn (Call $r) => $r->duration_formatted),
Tables\Columns\TextColumn::make('status')
->formatStateUsing(fn ($s) => Call::STATUSES[$s] ?? $s)
->formatStateUsing(fn ($s) => __(Call::STATUSES[$s] ?? $s))
->badge(),
])
->filters([