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:
@@ -19,7 +19,12 @@ class Onboarding extends Page
|
||||
|
||||
protected static bool $shouldRegisterNavigation = false;
|
||||
|
||||
protected static ?string $title = 'Bun venit în AutoCRM!';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return __('Bun venit în AutoCRM!');
|
||||
}
|
||||
|
||||
protected string $view = 'filament.tenant.pages.onboarding';
|
||||
|
||||
@@ -54,18 +59,18 @@ class Onboarding extends Page
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Schemas\Components\Section::make('Pas 1 — Datele afacerii')
|
||||
Schemas\Components\Section::make(__('Pas 1 — Datele afacerii'))
|
||||
->visible(fn () => $this->step === 1)
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('display_name')
|
||||
->label('Denumire afișată')->required()->maxLength(120),
|
||||
->label(__('Denumire afișată'))->required()->maxLength(120),
|
||||
Forms\Components\TextInput::make('city')
|
||||
->label('Oraș')->maxLength(60),
|
||||
->label(__('Oraș'))->maxLength(60),
|
||||
Forms\Components\TextInput::make('phone')
|
||||
->label('Telefon principal')->tel()->maxLength(40),
|
||||
->label(__('Telefon principal'))->tel()->maxLength(40),
|
||||
Forms\Components\Select::make('currency')
|
||||
->label('Monedă')
|
||||
->label(__('Monedă'))
|
||||
->options([
|
||||
'MDL' => 'MDL — Leu moldovenesc',
|
||||
'EUR' => 'EUR — Euro',
|
||||
@@ -78,28 +83,28 @@ class Onboarding extends Page
|
||||
->required()
|
||||
->searchable(),
|
||||
]),
|
||||
Schemas\Components\Section::make('Pas 2 — Brand & limbă')
|
||||
Schemas\Components\Section::make(__('Pas 2 — Brand & limbă'))
|
||||
->visible(fn () => $this->step === 2)
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\Select::make('language')
|
||||
->label('Limbă')
|
||||
->label(__('Limbă'))
|
||||
->options(['ro' => 'Română', 'ru' => 'Русский', 'en' => 'English'])
|
||||
->required(),
|
||||
Forms\Components\ColorPicker::make('theme_color')
|
||||
->label('Culoare brand'),
|
||||
->label(__('Culoare brand')),
|
||||
Forms\Components\FileUpload::make('logo')
|
||||
->label('Logo (opțional)')
|
||||
->label(__('Logo (opțional)'))
|
||||
->image()->imageEditor()->disk('public')
|
||||
->directory('tmp-uploads')->visibility('public')
|
||||
->maxSize(2048),
|
||||
]),
|
||||
Schemas\Components\Section::make('Pas 3 — Tarif & terminat')
|
||||
Schemas\Components\Section::make(__('Pas 3 — Tarif & terminat'))
|
||||
->visible(fn () => $this->step === 3)
|
||||
->columns(1)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('labor_rate')
|
||||
->label('Tarif normo-oră (poți schimba oricând)')
|
||||
->label(__('Tarif normo-oră (poți schimba oricând)'))
|
||||
->numeric()->required(),
|
||||
]),
|
||||
])
|
||||
@@ -147,8 +152,8 @@ class Onboarding extends Page
|
||||
}
|
||||
|
||||
Notification::make()
|
||||
->title('🎉 Bun venit în AutoCRM!')
|
||||
->body('Setările au fost salvate. Hai să adăugăm primul client.')
|
||||
->title(__('🎉 Bun venit în AutoCRM!'))
|
||||
->body(__('Setările au fost salvate. Hai să adăugăm primul client.'))
|
||||
->success()
|
||||
->send();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user