Merge pull request #17760 from Godmartinz/fix-translation-string-in-notifications

Fixes #17759 translation used in asset check in/out notifications
This commit is contained in:
snipe
2025-09-03 14:33:57 +01:00
committed by GitHub
3 changed files with 14 additions and 14 deletions

View File

@@ -93,7 +93,7 @@ class CheckinAssetNotification extends Notification
return (new SlackMessage)
->content(':arrow_down: :computer: '.trans('mail.Asset_Checkin_Notification'))
->content(':arrow_down: :computer: '.trans('mail.Asset_Checkin_Notification', ['tag' => '']))
->from($botname)
->to($channel)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
@@ -112,21 +112,21 @@ class CheckinAssetNotification extends Notification
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
->title(trans('mail.Asset_Checkin_Notification'))
->title(trans('mail.Asset_Checkin_Notification', ['tag' => '']))
->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->display_name), '', 'activityText')
->fact(trans('mail.checked_into'), ($item->location) ? $item->location->name : '')
->fact(trans('mail.Asset_Checkin_Notification') . " by ", $admin->display_name)
->fact(trans('general.administrator'), $admin->display_name)
->fact(trans('admin/hardware/form.status'), $item->assetstatus?->name)
->fact(trans('mail.notes'), $note ?: '');
}
$message = trans('mail.Asset_Checkin_Notification');
$message = trans('mail.Asset_Checkin_Notification', ['tag' => '']);
$details = [
trans('mail.asset') => htmlspecialchars_decode($item->display_name),
trans('mail.checked_into') => ($item->location) ? $item->location->name : '',
trans('mail.Asset_Checkin_Notification')." by " => $admin->display_name,
trans('general.administrator') => $admin->display_name,
trans('admin/hardware/form.status') => $item->assetstatus?->name,
trans('mail.notes') => $note ?: '',
];
@@ -144,7 +144,7 @@ class CheckinAssetNotification extends Notification
->card(
Card::create()
->header(
'<strong>'.trans('mail.Asset_Checkin_Notification').'</strong>' ?: '',
'<strong>'.trans('mail.Asset_Checkin_Notification', ['tag' =>'']).'</strong>' ?: '',
htmlspecialchars_decode($item->display_name) ?: '',
)
->section(

View File

@@ -110,7 +110,7 @@ class CheckoutAssetNotification extends Notification
}
return (new SlackMessage)
->content(':arrow_up: :computer: '.trans('mail.Asset_Checkout_Notification'))
->content(':arrow_up: :computer: '.trans('mail.Asset_Checkout_Notification', ['tag' => '']))
->from($botname)
->to($channel)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
@@ -131,19 +131,19 @@ class CheckoutAssetNotification extends Notification
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
->title(trans('mail.Asset_Checkout_Notification'))
->title(trans('mail.Asset_Checkout_Notification', ['tag' => '']))
->addStartGroupToSection('activityText')
->fact(trans('mail.assigned_to'), $target->display_name)
->fact(htmlspecialchars_decode($item->display_name), '', 'activityText')
->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->display_name)
->fact(trans('general.administrator'), $admin->display_name)
->fact(trans('mail.notes'), $note ?: '');
}
$message = trans('mail.Asset_Checkout_Notification');
$message = trans('mail.Asset_Checkout_Notification', ['tag' => '']);
$details = [
trans('mail.assigned_to') => $target->present()->name,
trans('mail.asset') => htmlspecialchars_decode($item->display_name),
trans('mail.Asset_Checkout_Notification'). ' by' => $admin->display_name,
trans('general.administrator') => $admin->display_name,
trans('mail.notes') => $note ?: '',
];
return array($message, $details);
@@ -159,7 +159,7 @@ public function toGoogleChat()
->card(
Card::create()
->header(
'<strong>'.trans('mail.Asset_Checkout_Notification').'</strong>' ?: '',
'<strong>'.trans('mail.Asset_Checkout_Notification', ['tag' => '']).'</strong>' ?: '',
htmlspecialchars_decode($item->display_name) ?: '',
)
->section(

View File

@@ -4,8 +4,8 @@ return [
'Accessory_Checkin_Notification' => 'Accessory checked in',
'Accessory_Checkout_Notification' => 'Accessory checked out',
'Asset_Checkin_Notification' => 'Asset checked in: [:tag]',
'Asset_Checkout_Notification' => 'Asset checked out: [:tag]',
'Asset_Checkin_Notification' => 'Asset checked in: :tag',
'Asset_Checkout_Notification' => 'Asset checked out: :tag',
'Confirm_Accessory_Checkin' => 'Accessory checkin confirmation',
'Confirm_Asset_Checkin' => 'Asset checkin confirmation',
'Confirm_component_checkin' => 'Component checkin confirmation',