i18n(markup-rules): +11 translations + wrap key label & categories

Wrapped the dynamic Select 'key' label (Brand/Categorie) with __(),
switched the category options to I18n::opts(). Notification 'Recalculat
preț pentru N piese' now uses __(:n) placeholder.

+11 keys: regulă, reguli markup, Cheie, Mai mic = aplicat primul.,
'Va recalcula sell_price…' confirm text, notification, 'Interval preț'
enum, and missing Part.CATEGORIES (Ulei, Filtre, Lichide, Distribuție).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 20:55:13 +00:00
parent 00fb4a304a
commit 2985c38d93
3 changed files with 21 additions and 13 deletions
@@ -60,10 +60,10 @@ class MarkupRuleResource extends Resource
->required()
->live(),
Forms\Components\Select::make('key')
->label(fn (Get $get) => $get('type') === 'brand' ? 'Brand' : 'Categorie')
->label(fn (Get $get) => $get('type') === 'brand' ? __('Brand') : __('Categorie'))
->options(fn (Get $get) => $get('type') === 'brand'
? Part::distinct()->pluck('brand', 'brand')->filter()->toArray()
: array_combine(Part::CATEGORIES, Part::CATEGORIES))
: \App\Support\I18n::opts(array_combine(Part::CATEGORIES, Part::CATEGORIES)))
->visible(fn (Get $get) => in_array($get('type'), ['category', 'brand'], true))
->searchable()
->required(fn (Get $get) => in_array($get('type'), ['category', 'brand'], true)),
@@ -127,7 +127,7 @@ class MarkupRuleResource extends Resource
$count++;
}
});
Notification::make()->title("Recalculat preț pentru {$count} piese")->success()->send();
Notification::make()->title(__('Recalculat preț pentru :n piese', ['n' => $count]))->success()->send();
}),
])
->actions([