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:
+15
-10
@@ -14,26 +14,31 @@ class DamagePointsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'damagePoints';
|
||||
|
||||
protected static ?string $title = 'Hartă daune';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __('Hartă daune');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Forms\Components\Select::make('zone')
|
||||
->label('Zonă')
|
||||
->label(__('Zonă'))
|
||||
->options(array_combine(DamagePoint::ZONES, DamagePoint::ZONES))
|
||||
->searchable()
|
||||
->required(),
|
||||
Forms\Components\Select::make('kind')
|
||||
->label('Tip daună')
|
||||
->label(__('Tip daună'))
|
||||
->options(array_combine(DamagePoint::KINDS, DamagePoint::KINDS))
|
||||
->required(),
|
||||
Forms\Components\Select::make('severity')
|
||||
->label('Gravitate')
|
||||
->label(__('Gravitate'))
|
||||
->options(DamagePoint::SEVERITIES)
|
||||
->default('minor')
|
||||
->required(),
|
||||
Forms\Components\Textarea::make('notes')->label('Observații')->rows(2)->columnSpanFull(),
|
||||
Forms\Components\Textarea::make('notes')->label(__('Observații'))->rows(2)->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -42,10 +47,10 @@ class DamagePointsRelationManager extends RelationManager
|
||||
return $table
|
||||
->recordTitleAttribute('zone')
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('zone')->label('Zonă')->badge()->color('gray'),
|
||||
Tables\Columns\TextColumn::make('kind')->label('Tip'),
|
||||
Tables\Columns\TextColumn::make('zone')->label(__('Zonă'))->badge()->color('gray'),
|
||||
Tables\Columns\TextColumn::make('kind')->label(__('Tip')),
|
||||
Tables\Columns\TextColumn::make('severity')
|
||||
->label('Gravitate')
|
||||
->label(__('Gravitate'))
|
||||
->formatStateUsing(fn ($s) => DamagePoint::SEVERITIES[$s] ?? $s)
|
||||
->badge()
|
||||
->colors(['gray' => ['minor'], 'warning' => ['medium'], 'danger' => ['severe']]),
|
||||
@@ -53,7 +58,7 @@ class DamagePointsRelationManager extends RelationManager
|
||||
])
|
||||
->headerActions([Actions\CreateAction::make()])
|
||||
->actions([Actions\EditAction::make(), Actions\DeleteAction::make()])
|
||||
->emptyStateHeading('Nicio daună marcată')
|
||||
->emptyStateDescription('Adaugă punctele de daună pe zone (capotă, ușă, aripă) cu tip și gravitate — formează harta de daune a mașinii.');
|
||||
->emptyStateHeading(__('Nicio daună marcată'))
|
||||
->emptyStateDescription(__('Adaugă punctele de daună pe zone (capotă, ușă, aripă) cu tip și gravitate — formează harta de daune a mașinii.'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user