Skip to content

Commit 4167c6e

Browse files
committed
Add some translations
1 parent ca3151c commit 4167c6e

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

app/Mail/BulkAssetCheckoutMail.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public function attachments(): array
6262
private function getSubject(): string
6363
{
6464
if ($this->assets->count() > 1) {
65-
// @todo: translate
66-
return 'Assets checked out';
65+
return ucfirst(trans('general.assets_checked_out_count'));
6766
}
6867

6968
return trans('mail.Asset_Checkout_Notification', ['tag' => $this->assets->first()->asset_tag]);
@@ -72,22 +71,10 @@ private function getSubject(): string
7271
private function getIntroduction(): string
7372
{
7473
if ($this->target instanceof Location) {
75-
if ($this->assets->count() === 1) {
76-
// @todo: translate
77-
return "An asset have been checked out to {$this->target->name}.";
78-
}
79-
80-
// @todo: translate
81-
return "Assets have been checked out to {$this->target->name}.";
82-
}
83-
84-
if ($this->assets->count() > 1) {
85-
// @todo: translate
86-
return 'Assets have been checked out to you.';
74+
return trans_choice('mail.new_item_checked_location', $this->assets->count(), ['location' => $this->target->name]);
8775
}
8876

89-
// @todo: translate
90-
return 'An asset has been checked out to you.';
77+
return trans_choice('mail.new_item_checked', $this->assets->count());
9178
}
9279

9380
private function acceptanceUrl()
@@ -145,14 +132,14 @@ private function getRequiresAcceptanceWording(): array
145132
if ($this->assets->count() > 1) {
146133
return [
147134
// todo: translate
148-
'One or more items require acceptance.',
135+
trans_choice('mail.items_checked_out_require_acceptance', $this->assets->count()),
149136
"**[✔ Click here to review the terms of use and accept the items]({$this->acceptanceUrl()})**",
150137
];
151138
}
152139

153140
return [
154141
// todo: translate
155-
'The checked out item requires acceptance.',
142+
trans_choice('mail.items_checked_out_require_acceptance', $this->assets->count()),
156143
"**[✔ Click here to review the terms of use and accept the item]({$this->acceptanceUrl()})**",
157144
];
158145
}

resources/lang/en-US/mail.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
'new_item_checked' => 'A new item has been checked out under your name, details are below.|:count new items have been checked out under your name, details are below.',
8080
'new_item_checked_with_acceptance' => 'A new item has been checked out under your name that requires acceptance, details are below.|:count new items have been checked out under your name that requires acceptance, details are below.',
8181
'new_item_checked_location' => 'A new item has been checked out to :location, details are below.|:count new items have been checked out to :location, details are below.',
82+
'items_checked_out_require_acceptance' => 'The checked out item requires acceptance.|One or more items require acceptance.',
8283
'recent_item_checked' => 'An item was recently checked out under your name that requires acceptance, details are below.',
8384
'notes' => 'Notes',
8485
'password' => 'Password',

resources/views/mail/markdown/bulk-asset-checkout-mail.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
| | |
4343
| ------------- | ------------- |
4444
@foreach($assets as $asset)
45-
| **Asset Tag** | <a href="{{ route('hardware.show', $asset->id) }}">{{ $asset->display_name }}</a><br><small>{{trans('mail.serial').': '.$asset->serial}}</small> |
45+
| **{{ trans('general.asset_tag') }}** | <a href="{{ route('hardware.show', $asset->id) }}">{{ $asset->display_name }}</a><br><small>{{trans('mail.serial').': '.$asset->serial}}</small> |
4646
@if (isset($asset->model?->category))
4747
| **{{ trans('general.category') }}** | {{ $asset->model->category->name }} |
4848
@endif

0 commit comments

Comments
 (0)