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
@@ -24,9 +24,19 @@ class VehicleResource extends Resource
return __('nav.label.Automobile');
}
protected static ?string $modelLabel = 'mașină';
protected static ?string $modelLabel = null;
protected static ?string $pluralModelLabel = 'mașini';
public static function getModelLabel(): string
{
return __('mașină');
}
protected static ?string $pluralModelLabel = null;
public static function getPluralModelLabel(): string
{
return __('mașini');
}
protected static ?int $navigationSort = 20;
@@ -51,21 +61,21 @@ class VehicleResource extends Resource
public static function form(Schema $schema): Schema
{
return $schema->components([
Schemas\Components\Section::make('Identificare')
Schemas\Components\Section::make(__('Identificare'))
->columns(2)
->schema([
Forms\Components\Select::make('client_id')
->label('Proprietar')
->label(__('Proprietar'))
->options(fn () => Client::pluck('name', 'id'))
->searchable()
->required(),
Forms\Components\TextInput::make('plate')->label('Nr. înmatriculare')->maxLength(16),
Forms\Components\TextInput::make('make')->label('Marca')->required()->maxLength(60),
Forms\Components\TextInput::make('plate')->label(__('Nr. înmatriculare'))->maxLength(16),
Forms\Components\TextInput::make('make')->label(__('Marca'))->required()->maxLength(60),
Forms\Components\TextInput::make('model')->required()->maxLength(60),
Forms\Components\TextInput::make('year')->numeric()->minValue(1950)->maxValue(2100),
Forms\Components\TextInput::make('vin')->maxLength(32),
]),
Schemas\Components\Section::make('Tehnice')
Schemas\Components\Section::make(__('Tehnice'))
->columns(2)
->schema([
Forms\Components\TextInput::make('engine')->maxLength(60),
@@ -76,13 +86,13 @@ class VehicleResource extends Resource
'EV' => 'Electric', 'GPL' => 'GPL', 'GNC' => 'GNC',
]),
Forms\Components\Select::make('vehicle_class')
->label('Clasă (pentru pricing)')
->label(__('Clasă (pentru pricing)'))
->options(\App\Models\Tenant\PricingCoefficient::VEHICLE_CLASSES)
->helperText('Folosită de coeficienții de preț. Hibrid/EV se deduc și din combustibil.'),
Forms\Components\TextInput::make('mileage')->label('Kilometraj')->numeric()->default(0),
->helperText(__('Folosită de coeficienții de preț. Hibrid/EV se deduc și din combustibil.')),
Forms\Components\TextInput::make('mileage')->label(__('Kilometraj'))->numeric()->default(0),
Forms\Components\TextInput::make('color')->maxLength(40),
]),
Forms\Components\Textarea::make('notes')->label('Notițe')->columnSpanFull()->rows(3),
Forms\Components\Textarea::make('notes')->label(__('Notițe'))->columnSpanFull()->rows(3),
]);
}
@@ -90,18 +100,18 @@ class VehicleResource extends Resource
{
return $table
->columns([
Tables\Columns\TextColumn::make('plate')->label('Nr.')->searchable(),
Tables\Columns\TextColumn::make('plate')->label(__('Nr.'))->searchable(),
Tables\Columns\TextColumn::make('make')->sortable(),
Tables\Columns\TextColumn::make('model'),
Tables\Columns\TextColumn::make('year'),
Tables\Columns\TextColumn::make('client.name')->label('Proprietar')->searchable(),
Tables\Columns\TextColumn::make('client.name')->label(__('Proprietar'))->searchable(),
Tables\Columns\TextColumn::make('vin')->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('mileage')->label('Km')->numeric(),
Tables\Columns\TextColumn::make('mileage')->label(__('Km'))->numeric(),
Tables\Columns\TextColumn::make('created_at')->date()->sortable(),
])
->actions([
Actions\Action::make('decode_vin')
->label('Decode VIN')
->label(__('Decode VIN'))
->icon('heroicon-m-cpu-chip')
->color('gray')
->visible(fn (\App\Models\Tenant\Vehicle $r) => ! empty($r->vin) && strlen($r->vin) === 17)
@@ -113,11 +123,11 @@ class VehicleResource extends Resource
return view('filament.tenant.vin-decode', ['info' => $info, 'vehicle' => $r]);
}),
Actions\Action::make('ai_recommend')
->label('AI: recomandări')
->label(__('AI: recomandări'))
->icon('heroicon-m-sparkles')
->color('primary')
->visible(fn (\App\Models\Tenant\Vehicle $r) => ! empty($r->vin))
->modalHeading('Recomandări AI')
->modalHeading(__('Recomandări AI'))
->modalSubmitAction(false)
->modalCancelActionLabel('Închide')
->modalContent(function (\App\Models\Tenant\Vehicle $r) {
@@ -128,8 +138,8 @@ class VehicleResource extends Resource
Actions\EditAction::make(),
Actions\DeleteAction::make(),
])
->emptyStateHeading('Nicio mașină încă')
->emptyStateDescription('Adaugă mașini manual sau importă din CSV. Folosește VIN-căutare pentru decoder rapid și completare automată brand/model/an.')
->emptyStateHeading(__('Nicio mașină încă'))
->emptyStateDescription(__('Adaugă mașini manual sau importă din CSV. Folosește VIN-căutare pentru decoder rapid și completare automată brand/model/an.'))
->emptyStateIcon('heroicon-o-truck')
->defaultSort('created_at', 'desc');
}