From 7b4ecb275f18e34012a8f16844d51520b659178d Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 18 Mar 2024 13:29:01 +0000 Subject: [PATCH] Use trans choice for language Signed-off-by: snipe --- resources/lang/en-US/general.php | 9 ++++++ resources/views/users/print.blade.php | 40 +++++++++++++++++---------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index d879ef7db3..bf17024844 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -519,4 +519,13 @@ return [ ], 'no_requestable' => 'There are no requestable assets or asset models.', + 'countable' => [ + 'accessories' => ':count Accessory|:count Accessories', + 'assets' => ':count Asset|:count Assets', + 'licenses' => ':count License|:count Licenses', + 'license_seats' => ':count License Seat|:count License Seats', + 'consumables' => ':count Consumable|:count Consumables', + 'components' => ':count Component|:count Components', + ] + ]; diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index 9d6b39dda2..11e50e2e87 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -73,15 +73,19 @@ @endif @endif -

{{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }} {{ ($show_user->jobtitle!='' ? ' - '.$show_user->jobtitle : '') }} +

+ {{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }} + {{ ($show_user->employee_num!='') ? ' (#'.$show_user->employee_num.') ' : '' }} + {{ ($show_user->jobtitle!='' ? ' - '.$show_user->jobtitle : '') }}

+

{{ trans('admin/users/general.all_assigned_list_generation')}} {{ Helper::getFormattedDateObject(now(), 'datetime', false) }} @if ($assets->count() > 0) @php $counter = 1; @endphp
-

{{ trans('general.assets') }}

+

{{ trans_choice('general.countable.assets', $assets->count(), ['count' => $assets->count()]) }}

count() > 0)
-

{{ trans('general.licenses') }}

+

{{ trans_choice('general.countable.licenses', $licenses->count(), ['count' => $licenses->count()]) }}

count() > 0)
-

{{ $accessories->count() }} {{ trans('general.accessories') }}

+

{{ trans_choice('general.countable.accessories', $accessories->count(), ['count' => $accessories->count()]) }}

+ @@ -257,6 +262,11 @@ @if ($accessory) + @@ -271,7 +281,7 @@ @if ($consumables->count() > 0)
-

{{ $consumables->count() }} {{ trans('general.consumables') }}

+

{{ trans_choice('general.countable.consumables', $consumables->count(), ['count' => $consumables->count()]) }}

{{ trans('general.image') }} {{ trans('general.name') }} {{ trans('general.category') }} {{ trans('admin/hardware/table.checkout_date') }}
{{ $acounter }} + @if ($accessory->getImageUrl()) + + @endif + {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} {{ $accessory->category->name }} {{ $accessory->pivot->created_at }}
@endif -
-
- {{ trans('admin/users/general.all_assigned_list_generation')}} {{ Helper::getFormattedDateObject(now(), 'datetime', false) }} -
-
-
- - +
{{ trans('general.signed_off_by') }}:
+ + + + - - + + + + +
{{ trans('general.signed_off_by') }}:________________________________________________________{{ trans('general.date') }}: ________________________________________________________{{ trans('general.date') }}:
{{ trans('admin/users/table.manager') }}:________________________________________________________{{ trans('general.date') }}: ________________________________________________________