Fix PDF locale and missing translations for ru/en
- Set app locale from user preference in PDF route before rendering - Wrap hardcoded strings (TOTAL, Subtotal, Achitat etc.) with __() - Translate status values via __() in blade - Add ru/en translations: statuses, totals, payment lines Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,6 +85,8 @@ Route::get('/app/appointments/pdf', function (Request $request) {
|
||||
// so user can print/save); forced download with ?download=1.
|
||||
Route::get('/app/work-orders/{workOrder}/pdf', function (Request $request, int $workOrder) {
|
||||
abort_unless(auth('web')->check(), 403);
|
||||
$locale = auth('web')->user()?->locale ?? config('app.locale');
|
||||
app()->setLocale($locale);
|
||||
$wo = \App\Models\Tenant\WorkOrder::findOrFail($workOrder);
|
||||
$svc = app(\App\Services\WorkOrderPdfService::class);
|
||||
$pdf = $svc->generate($wo);
|
||||
|
||||
Reference in New Issue
Block a user