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:
@@ -32,7 +32,12 @@ class PostResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'pod';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'posturi de lucru';
|
||||
protected static ?string $pluralModelLabel = null;
|
||||
|
||||
public static function getPluralModelLabel(): string
|
||||
{
|
||||
return __('posturi de lucru');
|
||||
}
|
||||
|
||||
protected static ?int $navigationSort = 76;
|
||||
|
||||
@@ -44,37 +49,37 @@ class PostResource extends Resource
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Schemas\Components\Section::make('Pod / Spațiu lucru')
|
||||
Schemas\Components\Section::make(__('Pod / Spațiu lucru'))
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')
|
||||
->label('Nume')
|
||||
->label(__('Nume'))
|
||||
->required()
|
||||
->maxLength(80)
|
||||
->placeholder('Ex: Pod 1, Curte 1, Atelier electric'),
|
||||
->placeholder(__('Ex: Pod 1, Curte 1, Atelier electric')),
|
||||
Forms\Components\ColorPicker::make('color')
|
||||
->default('#3b82f6'),
|
||||
Forms\Components\TextInput::make('hours_per_day')
|
||||
->label('Ore disponibile / zi')
|
||||
->label(__('Ore disponibile / zi'))
|
||||
->numeric()
|
||||
->step(0.5)
|
||||
->default(10)
|
||||
->helperText('Capacitatea zilnică în ore'),
|
||||
->helperText(__('Capacitatea zilnică în ore')),
|
||||
Forms\Components\Select::make('default_master_id')
|
||||
->label('Mecanic implicit')
|
||||
->label(__('Mecanic implicit'))
|
||||
->options(fn () => User::where('status', 'active')->pluck('name', 'id'))
|
||||
->searchable()
|
||||
->placeholder('Niciun mecanic implicit')
|
||||
->helperText('Va fi pre-completat când creezi o programare pentru acest pod'),
|
||||
->placeholder(__('Niciun mecanic implicit'))
|
||||
->helperText(__('Va fi pre-completat când creezi o programare pentru acest pod')),
|
||||
Forms\Components\TextInput::make('description')
|
||||
->label('Descriere')
|
||||
->label(__('Descriere'))
|
||||
->maxLength(255)
|
||||
->placeholder('Ex: cu lift, fără lift, doar diagnoză...')
|
||||
->placeholder(__('Ex: cu lift, fără lift, doar diagnoză...'))
|
||||
->columnSpanFull(),
|
||||
Forms\Components\TextInput::make('sort_order')
|
||||
->numeric()
|
||||
->default(100),
|
||||
Forms\Components\Toggle::make('is_active')->label('Activ')->default(true),
|
||||
Forms\Components\Toggle::make('is_active')->label(__('Activ'))->default(true),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
@@ -85,11 +90,11 @@ class PostResource extends Resource
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')->searchable()->sortable(),
|
||||
Tables\Columns\ColorColumn::make('color'),
|
||||
Tables\Columns\TextColumn::make('hours_per_day')->label('Ore/zi')->sortable(),
|
||||
Tables\Columns\TextColumn::make('defaultMaster.name')->label('Mecanic implicit')->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('hours_per_day')->label(__('Ore/zi'))->sortable(),
|
||||
Tables\Columns\TextColumn::make('defaultMaster.name')->label(__('Mecanic implicit'))->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('description')->placeholder('—')->limit(40)->toggleable(),
|
||||
Tables\Columns\TextColumn::make('appointments_count')->counts('appointments')->label('Programări')->badge(),
|
||||
Tables\Columns\ToggleColumn::make('is_active')->label('Activ'),
|
||||
Tables\Columns\TextColumn::make('appointments_count')->counts('appointments')->label(__('Programări'))->badge(),
|
||||
Tables\Columns\ToggleColumn::make('is_active')->label(__('Activ')),
|
||||
])
|
||||
->actions([
|
||||
Actions\EditAction::make(),
|
||||
|
||||
Reference in New Issue
Block a user