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:
@@ -110,13 +110,13 @@ class ViewCompany extends Page
|
||||
{
|
||||
return [
|
||||
Actions\Action::make('view_as')
|
||||
->label('Deschide tenantul')
|
||||
->label(__('Deschide tenantul'))
|
||||
->icon('heroicon-m-arrow-top-right-on-square')
|
||||
->color('primary')
|
||||
->url(fn () => $this->record->url('/app'))
|
||||
->openUrlInNewTab(),
|
||||
Actions\Action::make('issue_invoice')
|
||||
->label('Generează factură')
|
||||
->label(__('Generează factură'))
|
||||
->icon('heroicon-m-document-plus')
|
||||
->color('success')
|
||||
->visible(fn () => (bool) $this->record->plan_id)
|
||||
@@ -147,7 +147,7 @@ class ViewCompany extends Page
|
||||
$this->dispatch('$refresh');
|
||||
}),
|
||||
Actions\Action::make('upload_logo')
|
||||
->label('Logo')
|
||||
->label(__('Logo'))
|
||||
->icon('heroicon-m-photo')
|
||||
->color('gray')
|
||||
->schema([
|
||||
@@ -166,29 +166,29 @@ class ViewCompany extends Page
|
||||
$this->record->clearMediaCollection('logo');
|
||||
$this->record->addMedia($abs)->preservingOriginal()->toMediaCollection('logo');
|
||||
@unlink($abs);
|
||||
Notification::make()->title('Logo actualizat')->success()->send();
|
||||
Notification::make()->title(__('Logo actualizat'))->success()->send();
|
||||
}
|
||||
}),
|
||||
Actions\Action::make('edit')
|
||||
->label('Editează')
|
||||
->label(__('Editează'))
|
||||
->icon('heroicon-m-pencil')
|
||||
->url(fn () => CompanyResource::getUrl('edit', ['record' => $this->record])),
|
||||
Actions\Action::make('suspend')
|
||||
->label('Suspendă')->icon('heroicon-m-no-symbol')->color('danger')
|
||||
->label(__('Suspendă'))->icon('heroicon-m-no-symbol')->color('danger')
|
||||
->visible(fn () => in_array($this->record->status, ['active', 'trial']))
|
||||
->requiresConfirmation()
|
||||
->action(function () {
|
||||
app(\App\Services\CompanyProvisioner::class)->suspend($this->record);
|
||||
Notification::make()->title('Tenant suspendat.')->success()->send();
|
||||
Notification::make()->title(__('Tenant suspendat.'))->success()->send();
|
||||
$this->dispatch('$refresh');
|
||||
}),
|
||||
Actions\Action::make('activate')
|
||||
->label('Reactivează')->icon('heroicon-m-check-circle')->color('success')
|
||||
->label(__('Reactivează'))->icon('heroicon-m-check-circle')->color('success')
|
||||
->visible(fn () => in_array($this->record->status, ['suspended', 'expired']))
|
||||
->requiresConfirmation()
|
||||
->action(function () {
|
||||
app(\App\Services\CompanyProvisioner::class)->reactivate($this->record);
|
||||
Notification::make()->title('Tenant activat.')->success()->send();
|
||||
Notification::make()->title(__('Tenant activat.'))->success()->send();
|
||||
$this->dispatch('$refresh');
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user