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:
+12
-7
@@ -14,19 +14,24 @@ class PaymentsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'payments';
|
||||
|
||||
protected static ?string $title = 'Plăți';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __('Plăți');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Forms\Components\DatePicker::make('paid_at')->label('Data')->default(today())->required(),
|
||||
Forms\Components\TextInput::make('amount')->label('Sumă')->numeric()->required(),
|
||||
Forms\Components\DatePicker::make('paid_at')->label(__('Data'))->default(today())->required(),
|
||||
Forms\Components\TextInput::make('amount')->label(__('Sumă'))->numeric()->required(),
|
||||
Forms\Components\Select::make('method')
|
||||
->options(Payment::METHODS)
|
||||
->default('cash')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('reference')->label('Referință')->maxLength(64),
|
||||
Forms\Components\Textarea::make('notes')->label('Notițe')->columnSpanFull()->rows(2),
|
||||
Forms\Components\TextInput::make('reference')->label(__('Referință'))->maxLength(64),
|
||||
Forms\Components\Textarea::make('notes')->label(__('Notițe'))->columnSpanFull()->rows(2),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -35,9 +40,9 @@ class PaymentsRelationManager extends RelationManager
|
||||
return $table
|
||||
->recordTitleAttribute('amount')
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('paid_at')->label('Data')->date('d.m.Y'),
|
||||
Tables\Columns\TextColumn::make('paid_at')->label(__('Data'))->date('d.m.Y'),
|
||||
Tables\Columns\TextColumn::make('amount')->money('MDL')->alignRight()
|
||||
->summarize(Tables\Columns\Summarizers\Sum::make()->money('MDL')->label('Plătit')),
|
||||
->summarize(Tables\Columns\Summarizers\Sum::make()->money('MDL')->label(__('Plătit'))),
|
||||
Tables\Columns\TextColumn::make('method')
|
||||
->formatStateUsing(fn ($s) => Payment::METHODS[$s] ?? $s)
|
||||
->badge(),
|
||||
|
||||
Reference in New Issue
Block a user