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:
@@ -131,7 +131,7 @@ class SubscriptionResource extends Resource
|
||||
->url(fn ($record) => \App\Filament\Central\Resources\CompanyResource::getUrl('view', ['record' => $record->company_id])),
|
||||
Tables\Columns\TextColumn::make('plan.name')->label(__('Plan'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('period')
|
||||
->formatStateUsing(fn ($s) => Subscription::PERIODS[$s] ?? $s)
|
||||
->formatStateUsing(fn ($s) => __(Subscription::PERIODS[$s] ?? $s))
|
||||
->badge(),
|
||||
Tables\Columns\TextColumn::make('amount')
|
||||
->money(fn ($record) => $record->currency)
|
||||
@@ -139,7 +139,7 @@ class SubscriptionResource extends Resource
|
||||
->weight('bold'),
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->badge()
|
||||
->formatStateUsing(fn ($s) => Subscription::STATUSES[$s] ?? $s)
|
||||
->formatStateUsing(fn ($s) => __(Subscription::STATUSES[$s] ?? $s))
|
||||
->color(fn ($s) => match ($s) {
|
||||
'paid' => 'success',
|
||||
'overdue' => 'danger',
|
||||
|
||||
Reference in New Issue
Block a user