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
@@ -15,13 +15,18 @@ class DefaultPartsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'laborParts';
|
||||
|
||||
protected static ?string $title = 'Piese implicite';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __('Piese implicite');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Forms\Components\Select::make('part_id')
|
||||
->label('Piesă')
|
||||
->label(__('Piesă'))
|
||||
->options(fn () => Part::where('is_active', true)
|
||||
->get()
|
||||
->mapWithKeys(fn ($p) => [$p->id => "{$p->name} " . ($p->article ? "[{$p->article}]" : '')])
|
||||
@@ -34,8 +39,8 @@ class DefaultPartsRelationManager extends RelationManager
|
||||
$set('unit', $p->unit);
|
||||
}
|
||||
}),
|
||||
Forms\Components\TextInput::make('qty')->label('Cantitate')->numeric()->default(1)->required(),
|
||||
Forms\Components\TextInput::make('unit')->label('UM')->default('buc')->maxLength(16),
|
||||
Forms\Components\TextInput::make('qty')->label(__('Cantitate'))->numeric()->default(1)->required(),
|
||||
Forms\Components\TextInput::make('unit')->label(__('UM'))->default('buc')->maxLength(16),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -44,14 +49,14 @@ class DefaultPartsRelationManager extends RelationManager
|
||||
return $table
|
||||
->recordTitleAttribute('part.name')
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('part.name')->label('Piesă')->wrap(),
|
||||
Tables\Columns\TextColumn::make('part.article')->label('Cod')->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('qty')->label('Cant.')->alignRight(),
|
||||
Tables\Columns\TextColumn::make('unit')->label('UM'),
|
||||
Tables\Columns\TextColumn::make('part.name')->label(__('Piesă'))->wrap(),
|
||||
Tables\Columns\TextColumn::make('part.article')->label(__('Cod'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('qty')->label(__('Cant.'))->alignRight(),
|
||||
Tables\Columns\TextColumn::make('unit')->label(__('UM')),
|
||||
])
|
||||
->headerActions([Actions\CreateAction::make()])
|
||||
->actions([Actions\EditAction::make(), Actions\DeleteAction::make()])
|
||||
->emptyStateHeading('Nicio piesă implicită')
|
||||
->emptyStateDescription('Adaugă piesele care se montează de obicei la această manoperă — se adaugă automat în fișă când selectezi manopera.');
|
||||
->emptyStateHeading(__('Nicio piesă implicită'))
|
||||
->emptyStateDescription(__('Adaugă piesele care se montează de obicei la această manoperă — se adaugă automat în fișă când selectezi manopera.'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user