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:
2026-07-15 05:04:24 +00:00
parent 78ff8d4b43
commit f7fc69077b
83 changed files with 4212 additions and 1251 deletions
@@ -50,40 +50,40 @@ class PayrollRunResource extends Resource
public static function form(Schema $schema): Schema
{
return $schema->components([
Schemas\Components\Section::make('Detalii')
Schemas\Components\Section::make(__('Detalii'))
->columns(2)
->schema([
Forms\Components\Select::make('user_id')
->label('Utilizator')
->label(__('Utilizator'))
->options(fn () => User::orderBy('name')->pluck('name', 'id'))
->searchable()
->required(),
Forms\Components\TextInput::make('period')
->label('Perioada (YYYY-MM)')
->label(__('Perioada (YYYY-MM)'))
->placeholder(now()->format('Y-m'))
->required()
->regex('/^\d{4}-\d{2}$/'),
]),
Schemas\Components\Section::make('Calcul')
Schemas\Components\Section::make(__('Calcul'))
->columns(3)
->schema([
Forms\Components\TextInput::make('base')->label('Bază')->numeric()->default(0),
Forms\Components\TextInput::make('works_revenue')->label('Venit manopere')->numeric()->disabled(),
Forms\Components\TextInput::make('works_pct_amount')->label('Comision manopere')->numeric()->disabled(),
Forms\Components\TextInput::make('parts_margin')->label('Marja piese')->numeric()->disabled(),
Forms\Components\TextInput::make('parts_pct_amount')->label('Comision piese')->numeric()->disabled(),
Forms\Components\TextInput::make('base')->label(__('Bază'))->numeric()->default(0),
Forms\Components\TextInput::make('works_revenue')->label(__('Venit manopere'))->numeric()->disabled(),
Forms\Components\TextInput::make('works_pct_amount')->label(__('Comision manopere'))->numeric()->disabled(),
Forms\Components\TextInput::make('parts_margin')->label(__('Marja piese'))->numeric()->disabled(),
Forms\Components\TextInput::make('parts_pct_amount')->label(__('Comision piese'))->numeric()->disabled(),
Forms\Components\TextInput::make('bonus')->numeric()->default(0),
Forms\Components\TextInput::make('fines')->label('Penalizări')->numeric()->default(0),
Forms\Components\TextInput::make('advance')->label('Avans')->numeric()->default(0),
Forms\Components\TextInput::make('total')->label('Total net')->numeric()->disabled(),
Forms\Components\TextInput::make('fines')->label(__('Penalizări'))->numeric()->default(0),
Forms\Components\TextInput::make('advance')->label(__('Avans'))->numeric()->default(0),
Forms\Components\TextInput::make('total')->label(__('Total net'))->numeric()->disabled(),
]),
Schemas\Components\Section::make('Plată')
Schemas\Components\Section::make(__('Plată'))
->columns(2)
->schema([
Forms\Components\Toggle::make('paid')->label('Achitat'),
Forms\Components\DatePicker::make('paid_at')->label('Data plății'),
Forms\Components\Toggle::make('paid')->label(__('Achitat')),
Forms\Components\DatePicker::make('paid_at')->label(__('Data plății')),
]),
Forms\Components\Textarea::make('notes')->label('Notițe')->columnSpanFull()->rows(2),
Forms\Components\Textarea::make('notes')->label(__('Notițe'))->columnSpanFull()->rows(2),
]);
}
@@ -91,21 +91,21 @@ class PayrollRunResource extends Resource
{
return $table
->columns([
Tables\Columns\TextColumn::make('period')->label('Perioadă')->sortable(),
Tables\Columns\TextColumn::make('user.name')->label('Utilizator')->searchable(),
Tables\Columns\TextColumn::make('period')->label(__('Perioadă'))->sortable(),
Tables\Columns\TextColumn::make('user.name')->label(__('Utilizator'))->searchable(),
Tables\Columns\TextColumn::make('base')->money('MDL')->alignRight(),
Tables\Columns\TextColumn::make('works_pct_amount')->label('% manopere')->money('MDL')->alignRight(),
Tables\Columns\TextColumn::make('parts_pct_amount')->label('% piese')->money('MDL')->alignRight(),
Tables\Columns\TextColumn::make('works_pct_amount')->label(__('% manopere'))->money('MDL')->alignRight(),
Tables\Columns\TextColumn::make('parts_pct_amount')->label(__('% piese'))->money('MDL')->alignRight(),
Tables\Columns\TextColumn::make('bonus')->money('MDL')->alignRight()->color('success'),
Tables\Columns\TextColumn::make('fines')->money('MDL')->alignRight()->color('danger'),
Tables\Columns\TextColumn::make('advance')->money('MDL')->alignRight()->color('warning'),
Tables\Columns\TextColumn::make('total')->label('Total')->money('MDL')->alignRight()->weight('bold')
Tables\Columns\TextColumn::make('total')->label(__('Total'))->money('MDL')->alignRight()->weight('bold')
->summarize(Tables\Columns\Summarizers\Sum::make()->money('MDL')),
Tables\Columns\IconColumn::make('paid')->boolean(),
])
->headerActions([
Actions\Action::make('compute_all')
->label('Calculează luna curentă')
->label(__('Calculează luna curentă'))
->icon('heroicon-m-calculator')
->color('primary')
->action(function () {
@@ -122,13 +122,13 @@ class PayrollRunResource extends Resource
])
->filters([
Tables\Filters\SelectFilter::make('period')
->label('Perioadă')
->label(__('Perioadă'))
->options(fn () => PayrollRun::distinct()->pluck('period', 'period')->toArray()),
Tables\Filters\TernaryFilter::make('paid')->label('Achitat'),
Tables\Filters\TernaryFilter::make('paid')->label(__('Achitat')),
])
->actions([
Actions\Action::make('recompute')
->label('Recalculează')
->label(__('Recalculează'))
->icon('heroicon-m-arrow-path')
->action(fn (PayrollRun $r) => app(PayrollCalculator::class)->compute($r->user_id, $r->period)),
Actions\EditAction::make(),