From 70d95877d8d4595015643e329e79160cb561982d Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 16 Jul 2024 21:02:58 +0100 Subject: [PATCH] Translations for license checkout errors Signed-off-by: snipe --- app/Http/Controllers/Licenses/LicenseCheckoutController.php | 6 +++--- resources/lang/en-US/admin/licenses/message.php | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Licenses/LicenseCheckoutController.php b/app/Http/Controllers/Licenses/LicenseCheckoutController.php index 83bcb52a7c..2fb0434f62 100644 --- a/app/Http/Controllers/Licenses/LicenseCheckoutController.php +++ b/app/Http/Controllers/Licenses/LicenseCheckoutController.php @@ -94,14 +94,14 @@ class LicenseCheckoutController extends Controller if (! $licenseSeat) { if ($seatId) { - throw new \Illuminate\Http\Exceptions\HttpResponseException(redirect()->route('licenses.index')->with('error', 'This Seat is not available for checkout.')); + throw new \Illuminate\Http\Exceptions\HttpResponseException(redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkout.unavailable'))); } - throw new \Illuminate\Http\Exceptions\HttpResponseException(redirect()->route('licenses.index')->with('error', 'There are no available seats for this license.')); + throw new \Illuminate\Http\Exceptions\HttpResponseException(redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkout.not_enough_seats'))); } if (! $licenseSeat->license->is($license)) { - throw new \Illuminate\Http\Exceptions\HttpResponseException(redirect()->route('licenses.index')->with('error', 'The license seat provided does not match the license.')); + throw new \Illuminate\Http\Exceptions\HttpResponseException(redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkout.mismatch'))); } return $licenseSeat; diff --git a/resources/lang/en-US/admin/licenses/message.php b/resources/lang/en-US/admin/licenses/message.php index 27fbfe38a9..7f5981aa05 100644 --- a/resources/lang/en-US/admin/licenses/message.php +++ b/resources/lang/en-US/admin/licenses/message.php @@ -44,6 +44,8 @@ return array( 'error' => 'There was an issue checking out the license. Please try again.', 'success' => 'The license was checked out successfully', 'not_enough_seats' => 'Not enough license seats available for checkout', + 'mismatch' => 'The license seat provided does not match the license', + 'unavailable' => 'This seat is not available for checkout.', ), 'checkin' => array(