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:
@@ -21,14 +21,14 @@ class ListPurchases extends ListRecords
|
||||
{
|
||||
return [
|
||||
Actions\Action::make('ocr')
|
||||
->label('Import factură (OCR)')
|
||||
->label(__('Import factură (OCR)'))
|
||||
->icon('heroicon-m-document-arrow-up')
|
||||
->color('gray')
|
||||
->modalHeading('Import factură via OCR')
|
||||
->modalDescription('Încarcă o poză cu factura. AI-ul extrage furnizorul, data și liniile. Verifici și salvezi.')
|
||||
->modalHeading(__('Import factură via OCR'))
|
||||
->modalDescription(__('Încarcă o poză cu factura. AI-ul extrage furnizorul, data și liniile. Verifici și salvezi.'))
|
||||
->schema([
|
||||
Forms\Components\FileUpload::make('invoice')
|
||||
->label('Foto factură')
|
||||
->label(__('Foto factură'))
|
||||
->image()
|
||||
->disk('local')
|
||||
->directory('ocr-imports')
|
||||
@@ -41,7 +41,7 @@ class ListPurchases extends ListRecords
|
||||
|
||||
if (! ($result['ok'] ?? false)) {
|
||||
Notification::make()
|
||||
->title('OCR eșuat')
|
||||
->title(__('OCR eșuat'))
|
||||
->body($result['error'] ?? 'Eroare necunoscută.')
|
||||
->danger()->send();
|
||||
@unlink($abs);
|
||||
@@ -83,7 +83,7 @@ class ListPurchases extends ListRecords
|
||||
@unlink($abs);
|
||||
|
||||
Notification::make()
|
||||
->title('Factură importată')
|
||||
->title(__('Factură importată'))
|
||||
->body(sprintf('%d linii, total %.2f. Verifică și ajustează înainte de a confirma.',
|
||||
count($payload['items']), (float) $purchase->total))
|
||||
->success()->send();
|
||||
|
||||
Reference in New Issue
Block a user