i18n: fix widget heading, translate Select options from model consts, +40 keys
- LowStockTable: rename getHeading → getTableHeading (correct Filament API) - Global I18n::opts() helper wraps Model::CONST values in __() so Select dropdowns show translated status/type/season/etc. labels - Sed-transform ->options(X::CONST), ->options(array_combine(X::A,X::A)), and formatStateUsing(fn($s)=>X::CONST[$s]??$s) → wrap with __() (58 options + 10 combines + 7 formatStateUsing across 28 files) - CalendarBoard: all 7 day names now via __() (was missing 4) - calendar-board.blade: fix untranslated 'săptămâna curentă', 'capacitate', 'rata confirmare', 'mediu', 'plin', 'Pod / Zi' / 'Mecanic / Zi' - +40 RU/EN translations (Client & Auto, Maistru / Mecanic, Programat, Sosit, Finalizat, Anulat, Neprezentat, days of week, calendar KPIs) All 306 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,7 @@ class TireSetResource extends Resource
|
||||
: [])
|
||||
->searchable(),
|
||||
Forms\Components\TextInput::make('label')->label(__('Etichetă'))->placeholder(__('ex: Iarnă Michelin')),
|
||||
Forms\Components\Select::make('season')->label(__('Sezon'))->options(TireSet::SEASONS)->default('winter')->required(),
|
||||
Forms\Components\Select::make('season')->label(__('Sezon'))->options(\App\Support\I18n::opts(TireSet::SEASONS))->default('winter')->required(),
|
||||
]),
|
||||
Schemas\Components\Section::make(__('Specificații'))
|
||||
->columns(3)
|
||||
@@ -78,7 +78,7 @@ class TireSetResource extends Resource
|
||||
Forms\Components\TextInput::make('dot_year')->label(__('DOT'))->maxLength(8)->placeholder('3621'),
|
||||
Forms\Components\Toggle::make('has_rims')->label(__('Cu jante')),
|
||||
Forms\Components\Select::make('rim_type')->label(__('Tip jante'))->options(['steel' => __('Tablă'), 'alloy' => 'Aliaj']),
|
||||
Forms\Components\Select::make('condition')->label(__('Stare'))->options(TireSet::CONDITIONS),
|
||||
Forms\Components\Select::make('condition')->label(__('Stare'))->options(\App\Support\I18n::opts(TireSet::CONDITIONS)),
|
||||
]),
|
||||
Schemas\Components\Section::make(__('Uzură (mm) per poziție'))
|
||||
->columns(4)
|
||||
@@ -130,7 +130,7 @@ class TireSetResource extends Resource
|
||||
->color(fn ($state) => $state === '—' ? 'gray' : 'success'),
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('season')->options(TireSet::SEASONS),
|
||||
Tables\Filters\SelectFilter::make('season')->options(\App\Support\I18n::opts(TireSet::SEASONS)),
|
||||
Tables\Filters\Filter::make('stored')
|
||||
->label(__('În depozit'))
|
||||
->query(fn ($q) => $q->whereHas('storage', fn ($s) => $s->where('status', 'stored'))),
|
||||
|
||||
Reference in New Issue
Block a user