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:
+11
-6
@@ -13,13 +13,18 @@ class CrossRefsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'crossRefs';
|
||||
|
||||
protected static ?string $title = 'Coduri cross (OEM/echivalente)';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __('Coduri cross (OEM/echivalente)');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Forms\Components\TextInput::make('cross_article')->label('Cod echivalent')->required()->maxLength(64),
|
||||
Forms\Components\TextInput::make('brand')->label('Brand')->maxLength(64),
|
||||
Forms\Components\TextInput::make('cross_article')->label(__('Cod echivalent'))->required()->maxLength(64),
|
||||
Forms\Components\TextInput::make('brand')->label(__('Brand'))->maxLength(64),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -28,12 +33,12 @@ class CrossRefsRelationManager extends RelationManager
|
||||
return $table
|
||||
->recordTitleAttribute('cross_article')
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('cross_article')->label('Cod')->searchable(),
|
||||
Tables\Columns\TextColumn::make('cross_article')->label(__('Cod'))->searchable(),
|
||||
Tables\Columns\TextColumn::make('brand')->placeholder('—'),
|
||||
])
|
||||
->headerActions([Actions\CreateAction::make()])
|
||||
->actions([Actions\EditAction::make(), Actions\DeleteAction::make()])
|
||||
->emptyStateHeading('Niciun cod cross')
|
||||
->emptyStateDescription('Adaugă coduri echivalente OEM/aftermarket ca să fie găsite în căutarea din magazin.');
|
||||
->emptyStateHeading(__('Niciun cod cross'))
|
||||
->emptyStateDescription(__('Adaugă coduri echivalente OEM/aftermarket ca să fie găsite în căutarea din magazin.'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user