From d5c9fa823e5b029de126510f9bae5a972cce0e62 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 24 Jul 2024 11:39:33 -0700 Subject: [PATCH] adds translations --- app/Http/Controllers/DepreciationsController.php | 4 ++-- resources/lang/en-US/validation.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/DepreciationsController.php b/app/Http/Controllers/DepreciationsController.php index 549d676d0..c564cc98f 100755 --- a/app/Http/Controllers/DepreciationsController.php +++ b/app/Http/Controllers/DepreciationsController.php @@ -69,7 +69,7 @@ class DepreciationsController extends Controller 'numeric', function ($attribute, $value, $fail) use ($request) { if ($request->input('depreciation_type') == 'percent' && ($value < 0 || $value > 100)) { - $fail('The depreciation minimum must be between 0 and 100 when depreciation type is percentage.'); + $fail(trans('validation.percent')); } }, ], @@ -137,7 +137,7 @@ class DepreciationsController extends Controller 'numeric', function ($attribute, $value, $fail) use ($request) { if ($request->input('depreciation_type') == 'percent' && ($value < 0 || $value > 100)) { - $fail('The depreciation minimum must be between 0 and 100 when depreciation type is percentage.'); + $fail(trans('validation.percent')); } }, ], diff --git a/resources/lang/en-US/validation.php b/resources/lang/en-US/validation.php index 05374e23a..45c501071 100644 --- a/resources/lang/en-US/validation.php +++ b/resources/lang/en-US/validation.php @@ -72,6 +72,7 @@ return [ 'not_in' => 'The selected :attribute is invalid.', 'numeric' => 'The :attribute must be a number.', 'present' => 'The :attribute field must be present.', + 'percent' => 'The depreciation minimum must be between 0 and 100 when depreciation type is percentage.', 'valid_regex' => 'That is not a valid regex. ', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.',