feat(i18n): wrap 1103 hardcoded UI strings across Filament with __()

- Convert static $modelLabel/$pluralModelLabel/$title to getter methods
- Wrap ->label()/->placeholder()/->helperText()/->description()/->title()/->body() args
- Wrap Section::make()/Fieldset::make()/Notification::make()->title() args
- Fix RelationManagers::getTitle() signature to match parent (Model, string)
- Fix Pages::getTitle() to instance method (BasePage::getTitle is non-static)
- Extend lang/ru.json + lang/en.json with 700+ common terms; identity fallback for the rest
- Remove duplicate getters in 5 resources that had manual getModelLabel already

All 306 tests pass. Missing translations fall back to the RO key so the UI never breaks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-15 05:04:24 +00:00
parent 78ff8d4b43
commit f7fc69077b
83 changed files with 4212 additions and 1251 deletions
@@ -38,19 +38,19 @@ class SubcontractorResource extends Resource
{
return $schema->components([
Schemas\Components\Section::make()->columns(2)->schema([
Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(160),
Forms\Components\TextInput::make('name')->label(__('Nume'))->required()->maxLength(160),
Forms\Components\Select::make('specialty')
->label('Specialitate')
->label(__('Specialitate'))
->options(array_combine(Subcontractor::SPECIALTIES, Subcontractor::SPECIALTIES))
->searchable(),
Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->maxLength(40),
Forms\Components\TextInput::make('phone')->label(__('Telefon'))->tel()->maxLength(40),
Forms\Components\TextInput::make('email')->email()->maxLength(120),
Forms\Components\Select::make('rating')
->label('Rating')
->label(__('Rating'))
->options([1 => '★', 2 => '★★', 3 => '★★★', 4 => '★★★★', 5 => '★★★★★'])
->default(3),
Forms\Components\Toggle::make('is_active')->label('Activ')->default(true),
Forms\Components\Textarea::make('notes')->label('Observații')->columnSpanFull()->rows(2),
Forms\Components\Toggle::make('is_active')->label(__('Activ'))->default(true),
Forms\Components\Textarea::make('notes')->label(__('Observații'))->columnSpanFull()->rows(2),
]),
]);
}
@@ -63,18 +63,18 @@ class SubcontractorResource extends Resource
Tables\Columns\TextColumn::make('specialty')->badge()->placeholder('—'),
Tables\Columns\TextColumn::make('phone')->copyable()->placeholder('—'),
Tables\Columns\TextColumn::make('rating')->formatStateUsing(fn ($s) => str_repeat('★', (int) $s)),
Tables\Columns\TextColumn::make('jobs_count')->counts('jobs')->label('Lucrări')->alignRight(),
Tables\Columns\TextColumn::make('jobs_count')->counts('jobs')->label(__('Lucrări'))->alignRight(),
Tables\Columns\IconColumn::make('is_active')->boolean(),
])
->filters([
Tables\Filters\TernaryFilter::make('is_active')->label('Activi'),
Tables\Filters\TernaryFilter::make('is_active')->label(__('Activi')),
])
->actions([
Actions\EditAction::make(),
Actions\DeleteAction::make(),
])
->emptyStateHeading('Niciun subcontractor')
->emptyStateDescription('Adaugă atelierele terțe la care trimiți lucrări (turbo, cutii, vopsitorie, PDR) și urmărește costul + marja.')
->emptyStateHeading(__('Niciun subcontractor'))
->emptyStateDescription(__('Adaugă atelierele terțe la care trimiți lucrări (turbo, cutii, vopsitorie, PDR) și urmărește costul + marja.'))
->emptyStateIcon('heroicon-o-user-group')
->defaultSort('name');
}