From 64a170b7f9cc4b386a2de6d36450749e10b37ef9 Mon Sep 17 00:00:00 2001 From: Vasyka Date: Sun, 26 Jul 2026 10:47:00 +0000 Subject: [PATCH] i18n(work-order works): translate labor Select category + h suffix + modal titles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- .../RelationManagers/WorksRelationManager.php | 6 ++++-- lang/en.json | 3 +++ lang/ru.json | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Filament/Tenant/Resources/WorkOrderResource/RelationManagers/WorksRelationManager.php b/app/Filament/Tenant/Resources/WorkOrderResource/RelationManagers/WorksRelationManager.php index 57eef7e..c38f21c 100644 --- a/app/Filament/Tenant/Resources/WorkOrderResource/RelationManagers/WorksRelationManager.php +++ b/app/Filament/Tenant/Resources/WorkOrderResource/RelationManagers/WorksRelationManager.php @@ -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(); }), ]) diff --git a/lang/en.json b/lang/en.json index 2644bc1..238d641 100644 --- a/lang/en.json +++ b/lang/en.json @@ -108,6 +108,8 @@ "Adaugă header": "Add header", "Adaugă imagine": "Add image", "Adaugă manopere și piese care se aplică împreună când selectezi acest șablon pe o fișă.": "Add labors and parts applied together when selecting this template on an order.", + "Adaugă manoperă": "Add labor", + "Adaugă manoperă în fișă": "Add labor to order", "Adaugă mașini manual sau importă din CSV. Folosește VIN-căutare pentru decoder rapid și completare automată brand/model/an.": "Add vehicles manually or import from CSV. Use VIN search for quick decode and auto-fill of brand/model/year.", "Adaugă mașină": "Add vehicle", "Adaugă notă": "Add note", @@ -1418,6 +1420,7 @@ "Piese (vânzare)": "Parts (sales)", "Piese impl.": "Default parts", "Piese implicite": "Default parts", + "Piese implicite adăugate (:n)": "Default parts added (:n)", "Piese în stoc": "Piese în stoc", "Piesă": "Part", "Piesă din catalog": "Part from catalog", diff --git a/lang/ru.json b/lang/ru.json index b686b5f..30e00e3 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -108,6 +108,8 @@ "Adaugă header": "Добавить заголовок", "Adaugă imagine": "Добавить изображение", "Adaugă manopere și piese care se aplică împreună când selectezi acest șablon pe o fișă.": "Добавьте работы и запчасти, которые применяются вместе при выборе этого шаблона в наряде.", + "Adaugă manoperă": "Добавить работу", + "Adaugă manoperă în fișă": "Добавить работу в наряд", "Adaugă mașini manual sau importă din CSV. Folosește VIN-căutare pentru decoder rapid și completare automată brand/model/an.": "Добавляйте авто вручную или импортируйте из CSV. Используйте поиск VIN для быстрого декодера и авто-заполнения марка/модель/год.", "Adaugă mașină": "Добавить авто", "Adaugă notă": "Добавить заметку", @@ -1418,6 +1420,7 @@ "Piese (vânzare)": "Запчасти (продажа)", "Piese impl.": "Запчасти", "Piese implicite": "Запчасти по умолчанию", + "Piese implicite adăugate (:n)": "Добавлены запчасти по умолчанию (:n)", "Piese în stoc": "Piese în stoc", "Piesă": "Запчасть", "Piesă din catalog": "Запчасть из каталога",