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
@@ -10,36 +10,41 @@ class BatchesRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'batches';
|
||||
|
||||
protected static ?string $title = 'Loturi (FIFO)';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __('Loturi (FIFO)');
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('received_at')
|
||||
->label('Recepție')
|
||||
->label(__('Recepție'))
|
||||
->dateTime('d.m.Y H:i')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('warehouse.code')->label('Depozit')->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('batch_ref')->label('Ref.')->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('supplier.name')->label('Furnizor')->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('warehouse.code')->label(__('Depozit'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('batch_ref')->label(__('Ref.'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('supplier.name')->label(__('Furnizor'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('qty_in')
|
||||
->label('Intrat')
|
||||
->label(__('Intrat'))
|
||||
->numeric(decimalPlaces: 2)
|
||||
->alignRight(),
|
||||
Tables\Columns\TextColumn::make('qty_remaining')
|
||||
->label('Rămas')
|
||||
->label(__('Rămas'))
|
||||
->numeric(decimalPlaces: 2)
|
||||
->alignRight()
|
||||
->weight('bold')
|
||||
->color(fn ($state) => (float) $state <= 0 ? 'gray' : 'success'),
|
||||
Tables\Columns\TextColumn::make('buy_price')
|
||||
->label('Preț unit.')
|
||||
->label(__('Preț unit.'))
|
||||
->money('MDL')
|
||||
->alignRight(),
|
||||
])
|
||||
->defaultSort('received_at')
|
||||
->emptyStateHeading('Niciun lot înregistrat')
|
||||
->emptyStateDescription('Apasă „Recepție" pe lista de piese pentru a înregistra prima intrare în depozit.');
|
||||
->emptyStateHeading(__('Niciun lot înregistrat'))
|
||||
->emptyStateDescription(__('Apasă „Recepție" pe lista de piese pentru a înregistra prima intrare în depozit.'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user