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
+17 -17
View File
@@ -52,25 +52,25 @@ class LeadResource extends Resource
public static function form(Schema $schema): Schema
{
return $schema->components([
Schemas\Components\Section::make('Contact')
Schemas\Components\Section::make(__('Contact'))
->columns(2)
->schema([
Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120),
Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->required()->maxLength(40),
Forms\Components\TextInput::make('name')->label(__('Nume'))->required()->maxLength(120),
Forms\Components\TextInput::make('phone')->label(__('Telefon'))->tel()->required()->maxLength(40),
Forms\Components\TextInput::make('email')->email()->maxLength(120),
Forms\Components\Select::make('status')
->options(Lead::STATUSES)
->default('new')
->required(),
]),
Schemas\Components\Section::make('Auto')
Schemas\Components\Section::make(__('Auto'))
->columns(2)
->schema([
Forms\Components\TextInput::make('car')->label('Marca')->maxLength(60),
Forms\Components\TextInput::make('car')->label(__('Marca'))->maxLength(60),
Forms\Components\TextInput::make('model')->maxLength(60),
]),
Forms\Components\Textarea::make('message')->label('Mesaj client')->columnSpanFull()->rows(3),
Schemas\Components\Section::make('Sursă & Atribuire')
Forms\Components\Textarea::make('message')->label(__('Mesaj client'))->columnSpanFull()->rows(3),
Schemas\Components\Section::make(__('Sursă & Atribuire'))
->columns(2)
->schema([
Forms\Components\Select::make('source')
@@ -78,12 +78,12 @@ class LeadResource extends Resource
->searchable()
->default('manual'),
Forms\Components\Select::make('assigned_to')
->label('Responsabil')
->label(__('Responsabil'))
->options(fn () => User::pluck('name', 'id'))
->searchable(),
Forms\Components\TextInput::make('budget')->label('Buget')->numeric(),
Forms\Components\TextInput::make('budget')->label(__('Buget'))->numeric(),
]),
Schemas\Components\Section::make('Marketing (UTM)')
Schemas\Components\Section::make(__('Marketing (UTM)'))
->collapsed()
->columns(2)
->schema([
@@ -93,7 +93,7 @@ class LeadResource extends Resource
Forms\Components\TextInput::make('utm_term'),
Forms\Components\TextInput::make('utm_content'),
]),
Forms\Components\Textarea::make('notes')->label('Notițe interne')->columnSpanFull()->rows(2),
Forms\Components\Textarea::make('notes')->label(__('Notițe interne'))->columnSpanFull()->rows(2),
]);
}
@@ -101,11 +101,11 @@ class LeadResource extends Resource
{
return $table
->columns([
Tables\Columns\TextColumn::make('created_at')->label('Data')->dateTime('d.m.Y H:i')->sortable(),
Tables\Columns\TextColumn::make('created_at')->label(__('Data'))->dateTime('d.m.Y H:i')->sortable(),
Tables\Columns\TextColumn::make('name')->searchable()->sortable(),
Tables\Columns\TextColumn::make('phone')->copyable()->searchable(),
Tables\Columns\TextColumn::make('car')->label('Auto')->formatStateUsing(fn ($state, $record) => trim($state . ' ' . ($record->model ?? ''))),
Tables\Columns\TextColumn::make('source')->label('Sursă')->formatStateUsing(fn ($state) => Lead::SOURCES[$state] ?? $state)->badge(),
Tables\Columns\TextColumn::make('car')->label(__('Auto'))->formatStateUsing(fn ($state, $record) => trim($state . ' ' . ($record->model ?? ''))),
Tables\Columns\TextColumn::make('source')->label(__('Sursă'))->formatStateUsing(fn ($state) => Lead::SOURCES[$state] ?? $state)->badge(),
Tables\Columns\TextColumn::make('status')
->formatStateUsing(fn ($state) => Lead::STATUSES[$state] ?? $state)
->badge()
@@ -116,7 +116,7 @@ class LeadResource extends Resource
'success' => ['converted'],
'danger' => ['lost'],
]),
Tables\Columns\TextColumn::make('assignedTo.name')->label('Responsabil')->placeholder('—'),
Tables\Columns\TextColumn::make('assignedTo.name')->label(__('Responsabil'))->placeholder('—'),
Tables\Columns\TextColumn::make('budget')->money('MDL')->placeholder('—'),
])
->filters([
@@ -125,7 +125,7 @@ class LeadResource extends Resource
])
->actions([
Actions\Action::make('convert')
->label('Convertește')
->label(__('Convertește'))
->icon('heroicon-m-arrow-right-circle')
->color('success')
->visible(fn (Lead $r) => $r->status !== 'converted')
@@ -141,7 +141,7 @@ class LeadResource extends Resource
Actions\DeleteAction::make(),
])
->emptyStateHeading('Nicio cerere primită')
->emptyStateDescription('Aici apar cererile clienților potențiali. Convertește-le în deal-uri sau direct în programări de la butonul „Convertește".')
->emptyStateDescription(__('Aici apar cererile clienților potențiali. Convertește-le în deal-uri sau direct în programări de la butonul „Convertește".'))
->emptyStateIcon('heroicon-o-inbox-arrow-down')
->defaultSort('created_at', 'desc');
}