From f2028178526d7aed9194bb7af29f8523d67661a9 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 6 Mar 2025 12:43:59 -0800 Subject: [PATCH] Use translation strings --- app/Mail/CheckoutAssetMail.php | 12 ++++++------ resources/lang/en-US/mail.php | 4 +++- .../views/mail/markdown/checkout-asset.blade.php | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Mail/CheckoutAssetMail.php b/app/Mail/CheckoutAssetMail.php index a810ab8c8..7ac20861e 100644 --- a/app/Mail/CheckoutAssetMail.php +++ b/app/Mail/CheckoutAssetMail.php @@ -98,7 +98,7 @@ class CheckoutAssetMail extends Mailable 'accept_url' => $accept_url, 'last_checkout' => $this->last_checkout, 'expected_checkin' => $this->expected_checkin, - 'opening_line' => $this->openingLine(), + 'introduction_line' => $this->introductionLine(), ], ); } @@ -119,21 +119,21 @@ class CheckoutAssetMail extends Mailable return trans('mail.Asset_Checkout_Notification'); } - return 'Reminder: ' . trans('mail.unaccepted_asset_reminder'); + return trans('mail.unaccepted_asset_reminder'); } - private function openingLine(): string + private function introductionLine(): string { if ($this->firstTimeSending && $this->requiresAcceptance()) { - return 'A new item has been checked out under your name that requires acceptance, details are below.'; + return trans('mail.new_item_checked_with_acceptance'); } if ($this->firstTimeSending && !$this->requiresAcceptance()) { - return 'A new item has been checked out under your name, details are below.'; + return trans('mail.new_item_checked'); } if (!$this->firstTimeSending && $this->requiresAcceptance()) { - return 'An item was recently checked out under your name that requires acceptance, details are below.'; + return trans('mail.recent_item_checked'); } // we shouldn't get here but let's send a default message just in case diff --git a/resources/lang/en-US/mail.php b/resources/lang/en-US/mail.php index 7663a0167..797f735a2 100644 --- a/resources/lang/en-US/mail.php +++ b/resources/lang/en-US/mail.php @@ -66,6 +66,8 @@ return [ 'min_QTY' => 'Min QTY', 'name' => 'Name', 'new_item_checked' => 'A new item has been checked out under your name, details are below.', + 'new_item_checked_with_acceptance' => 'A new item has been checked out under your name that requires acceptance, details are below.', + 'recent_item_checked' => 'An item was recently checked out under your name that requires acceptance, details are below.', 'notes' => 'Notes', 'password' => 'Password', 'password_reset' => 'Password Reset', @@ -88,7 +90,7 @@ return [ 'upcoming-audits' => 'There is :count asset that is coming up for audit within :threshold days.|There are :count assets that are coming up for audit within :threshold days.', 'user' => 'User', 'username' => 'Username', - 'unaccepted_asset_reminder' => 'You have Unaccepted Assets.', + 'unaccepted_asset_reminder' => 'Reminder: You have Unaccepted Assets.', 'welcome' => 'Welcome :name', 'welcome_to' => 'Welcome to :web!', 'your_assets' => 'View Your Assets', diff --git a/resources/views/mail/markdown/checkout-asset.blade.php b/resources/views/mail/markdown/checkout-asset.blade.php index 8cb7101ab..1bcbe462b 100644 --- a/resources/views/mail/markdown/checkout-asset.blade.php +++ b/resources/views/mail/markdown/checkout-asset.blade.php @@ -1,7 +1,7 @@ @component('mail::message') # {{ trans('mail.hello') }} {{ $target->present()->fullName() }}, -{{ $opening_line }} +{{ $introduction_line }} @if (($snipeSettings->show_images_in_email =='1') && $item->getImageUrl())
Asset