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
+11 -11
View File
@@ -38,26 +38,26 @@ class CallResource extends Resource
public static function form(Schema $schema): Schema
{
return $schema->components([
Schemas\Components\Section::make('Apel')
Schemas\Components\Section::make(__('Apel'))
->columns(2)
->schema([
Forms\Components\DateTimePicker::make('called_at')->label('Data & ora')->default(now())->required(),
Forms\Components\DateTimePicker::make('called_at')->label(__('Data & ora'))->default(now())->required(),
Forms\Components\Select::make('direction')
->options(Call::DIRECTIONS)
->default('incoming')
->required(),
Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->required()->maxLength(40),
Forms\Components\TextInput::make('phone')->label(__('Telefon'))->tel()->required()->maxLength(40),
Forms\Components\Select::make('status')
->options(Call::STATUSES)
->default('answered')
->required(),
Forms\Components\TextInput::make('duration_sec')->label('Durată (sec)')->numeric()->default(0),
Forms\Components\TextInput::make('duration_sec')->label(__('Durată (sec)'))->numeric()->default(0),
Forms\Components\Select::make('client_id')
->label('Client')
->label(__('Client'))
->options(fn () => Client::pluck('name', 'id'))
->searchable(),
]),
Forms\Components\Textarea::make('notes')->label('Notițe')->columnSpanFull()->rows(2),
Forms\Components\Textarea::make('notes')->label(__('Notițe'))->columnSpanFull()->rows(2),
]);
}
@@ -65,7 +65,7 @@ class CallResource extends Resource
{
return $table
->columns([
Tables\Columns\TextColumn::make('called_at')->label('Data')->dateTime('d.m.Y H:i')->sortable(),
Tables\Columns\TextColumn::make('called_at')->label(__('Data'))->dateTime('d.m.Y H:i')->sortable(),
Tables\Columns\TextColumn::make('direction')
->formatStateUsing(fn ($s) => Call::DIRECTIONS[$s] ?? $s)
->badge()
@@ -75,8 +75,8 @@ class CallResource extends Resource
'danger' => ['missed'],
]),
Tables\Columns\TextColumn::make('phone')->copyable()->searchable(),
Tables\Columns\TextColumn::make('client.name')->label('Client')->placeholder('—'),
Tables\Columns\TextColumn::make('duration_formatted')->label('Durată')->state(fn (Call $r) => $r->duration_formatted),
Tables\Columns\TextColumn::make('client.name')->label(__('Client'))->placeholder('—'),
Tables\Columns\TextColumn::make('duration_formatted')->label(__('Durată'))->state(fn (Call $r) => $r->duration_formatted),
Tables\Columns\TextColumn::make('status')
->formatStateUsing(fn ($s) => Call::STATUSES[$s] ?? $s)
->badge(),
@@ -84,10 +84,10 @@ class CallResource extends Resource
->filters([
Tables\Filters\SelectFilter::make('direction')->options(Call::DIRECTIONS),
Tables\Filters\Filter::make('today')
->label('Astăzi')
->label(__('Astăzi'))
->query(fn ($q) => $q->whereDate('called_at', today())),
Tables\Filters\Filter::make('missed')
->label('Pierdute')
->label(__('Pierdute'))
->query(fn ($q) => $q->where('direction', 'missed')->orWhere('status', 'missed')),
])
->actions([