i18n(work-order works): translate labor Select category + h suffix + modal titles

- Labor Select options now build '[__(category)] name_ro (hours __(h))'
  so category chip and hour suffix translate on RU/EN. Labor name stays
  as name_ro (user data — separate long-term concern).
- CreateAction gets explicit label + modalHeading (was 'Create Work
  Order Work' auto-generated).
- Notification 'Piese implicite adăugate (N)' rewritten with __(':n')
  placeholder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-26 10:47:00 +00:00
parent 1f471cc1ea
commit 64a170b7f9
3 changed files with 10 additions and 2 deletions
@@ -31,7 +31,7 @@ class WorksRelationManager extends RelationManager
->label(__('Catalog manoperă'))
->options(fn () => Labor::where('is_active', true)
->get()
->mapWithKeys(fn ($l) => [$l->id => "[{$l->category}] {$l->name_ro} ({$l->hours}h)"])
->mapWithKeys(fn ($l) => [$l->id => '[' . __($l->category) . '] ' . $l->name_ro . ' (' . $l->hours . __('h') . ')'])
->toArray())
->searchable()
->live()
@@ -95,6 +95,8 @@ class WorksRelationManager extends RelationManager
])
->headerActions([
Actions\CreateAction::make()
->label(__('Adaugă manoperă'))
->modalHeading(__('Adaugă manoperă în fișă'))
->after(function (WorkOrderWork $record) {
// Auto-add the labor's default parts to the parent WO.
if (! $record->labor_id) return;
@@ -108,7 +110,7 @@ class WorksRelationManager extends RelationManager
}
}
\Filament\Notifications\Notification::make()
->title('Piese implicite adăugate (' . $labor->laborParts->count() . ')')
->title(__('Piese implicite adăugate (:n)', ['n' => $labor->laborParts->count()]))
->success()->send();
}),
])