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:
@@ -99,13 +99,13 @@ class BodyshopJobResource extends Resource
|
||||
Tables\Columns\TextColumn::make('client.name')->label(__('Client'))->searchable()->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('vehicle.plate')->label(__('Auto'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('type')
|
||||
->formatStateUsing(fn ($s) => BodyshopJob::TYPES[$s] ?? $s)
|
||||
->formatStateUsing(fn ($s) => __(BodyshopJob::TYPES[$s] ?? $s))
|
||||
->badge()->color('info'),
|
||||
Tables\Columns\IconColumn::make('is_insurance')->label(__('Asig.'))->boolean()->toggleable(),
|
||||
Tables\Columns\TextColumn::make('damage_points_count')->counts('damagePoints')->label(__('Daune'))->alignRight(),
|
||||
Tables\Columns\TextColumn::make('approved_amount')->label(__('Aprobat'))->money('MDL')->alignRight(),
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->formatStateUsing(fn ($s) => BodyshopJob::STATUSES[$s] ?? $s)
|
||||
->formatStateUsing(fn ($s) => __(BodyshopJob::STATUSES[$s] ?? $s))
|
||||
->badge()
|
||||
->colors([
|
||||
'gray' => ['estimate'],
|
||||
|
||||
Reference in New Issue
Block a user