From def5969e1cdde53cc46667a5d0aa5ee498461454 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 27 Oct 2025 12:34:30 +0000 Subject: [PATCH] Fixed #18097 - check for CJK in field labels as well as content --- app/Models/CheckoutAcceptance.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php index b036292077..b36ab2513f 100644 --- a/app/Models/CheckoutAcceptance.php +++ b/app/Models/CheckoutAcceptance.php @@ -190,6 +190,11 @@ class CheckoutAcceptance extends Model } $pdf->Ln(); + + // Check for CJK in the translation string for date. (This is a good proxy for the rest of the document) + Helper::hasRtl(trans('general.date')) ? $pdf->setRTL(true) : $pdf->setRTL(false); + Helper::isCjk(trans('general.date')) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true); + $pdf->writeHTML(trans('general.date') . ': ' . Helper::getFormattedDateObject(now(), 'datetime', false), true, 0, true, 0, ''); if ($data['company_name'] != null) { @@ -224,7 +229,6 @@ class CheckoutAcceptance extends Model foreach ($eula_lines as $eula_line) { Helper::hasRtl($eula_line) ? $pdf->setRTL(true) : $pdf->setRTL(false); Helper::isCjk($eula_line) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true); - $pdf->writeHTML(Helper::parseEscapedMarkedown($eula_line), true, 0, true, 0, ''); } $pdf->Ln(); @@ -239,8 +243,11 @@ class CheckoutAcceptance extends Model $pdf->Ln(); } + Helper::hasRtl(trans('general.notes')) ? $pdf->setRTL(true) : $pdf->setRTL(false); + Helper::isCjk(trans('general.notes')) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true); + if ($data['note'] != null) { - Helper::isCjk($data['note']) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true); + Helper::isCjk(trans('general.notes')) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true); $pdf->writeHTML(trans('general.notes') . ': ' . e($data['note']), true, 0, true, 0, ''); $pdf->Ln(); }