i18n(vehicle-create): +19 translations, wrap fuel/class options with I18n::opts

- Fuel select was passing raw strings ('Diesel', 'Hybrid', 'EV', 'Electric'
  hardcoded); rewrote as DB-key => RO-label pairs run through I18n::opts
- vehicle_class select now uses I18n::opts(PricingCoefficient::VEHICLE_CLASSES)
- +19 RU/EN entries: section titles (Identificare, Tehnice), field labels
  (Marca, Kilometraj, Clasă…), helper texts, vehicle-class enum values
  (Compact/SUV/Van/Commercial/Premium/Sport/Camion/Cabrio/Motocicletă),
  fuel enum values (Motorină/Hibrid/Electric/GPL/GNC), auto-generated
  headline keys (Fuel/Engine/Gearbox/Color).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 07:08:13 +00:00
parent 38e9426d47
commit f6364176ff
3 changed files with 42 additions and 19 deletions
@@ -81,13 +81,14 @@ class VehicleResource extends Resource
Forms\Components\TextInput::make('engine')->maxLength(60),
Forms\Components\TextInput::make('gearbox')->maxLength(60),
Forms\Components\Select::make('fuel')
->options([
__('Benzină') => __('Benzină'), 'Diesel' => 'Diesel', 'Hybrid' => 'Hybrid',
'EV' => 'Electric', 'GPL' => 'GPL', 'GNC' => 'GNC',
]),
->label(__('Combustibil'))
->options(\App\Support\I18n::opts([
'petrol' => 'Benzină', 'diesel' => 'Motorină', 'hybrid' => 'Hibrid',
'ev' => 'Electric', 'gpl' => 'GPL', 'gnc' => 'GNC',
])),
Forms\Components\Select::make('vehicle_class')
->label(__('Clasă (pentru pricing)'))
->options(\App\Models\Tenant\PricingCoefficient::VEHICLE_CLASSES)
->options(\App\Support\I18n::opts(\App\Models\Tenant\PricingCoefficient::VEHICLE_CLASSES))
->helperText(__('Folosită de coeficienții de preț. Hibrid/EV se deduc și din combustibil.')),
Forms\Components\TextInput::make('mileage')->label(__('Kilometraj'))->numeric()->default(0),
Forms\Components\TextInput::make('color')->maxLength(40),