Use translation strings

This commit is contained in:
Marcus Moore 2025-03-06 12:43:59 -08:00
parent 7df636515f
commit f202817852
No known key found for this signature in database
3 changed files with 10 additions and 8 deletions

View file

@ -98,7 +98,7 @@ class CheckoutAssetMail extends Mailable
'accept_url' => $accept_url, 'accept_url' => $accept_url,
'last_checkout' => $this->last_checkout, 'last_checkout' => $this->last_checkout,
'expected_checkin' => $this->expected_checkin, '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 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()) { 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()) { 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()) { 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 // we shouldn't get here but let's send a default message just in case

View file

@ -66,6 +66,8 @@ return [
'min_QTY' => 'Min QTY', 'min_QTY' => 'Min QTY',
'name' => 'Name', 'name' => 'Name',
'new_item_checked' => 'A new item has been checked out under your name, details are below.', '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', 'notes' => 'Notes',
'password' => 'Password', 'password' => 'Password',
'password_reset' => 'Password Reset', '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.', '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', 'user' => 'User',
'username' => 'Username', 'username' => 'Username',
'unaccepted_asset_reminder' => 'You have Unaccepted Assets.', 'unaccepted_asset_reminder' => 'Reminder: You have Unaccepted Assets.',
'welcome' => 'Welcome :name', 'welcome' => 'Welcome :name',
'welcome_to' => 'Welcome to :web!', 'welcome_to' => 'Welcome to :web!',
'your_assets' => 'View Your Assets', 'your_assets' => 'View Your Assets',

View file

@ -1,7 +1,7 @@
@component('mail::message') @component('mail::message')
# {{ trans('mail.hello') }} {{ $target->present()->fullName() }}, # {{ trans('mail.hello') }} {{ $target->present()->fullName() }},
{{ $opening_line }} {{ $introduction_line }}
@if (($snipeSettings->show_images_in_email =='1') && $item->getImageUrl()) @if (($snipeSettings->show_images_in_email =='1') && $item->getImageUrl())
<center><img src="{{ $item->getImageUrl() }}" alt="Asset" style="max-width: 570px;"></center> <center><img src="{{ $item->getImageUrl() }}" alt="Asset" style="max-width: 570px;"></center>