Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion resources/views/packages/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ class="d-block lh-sm small fw-medium m-0 stretched-link link-body-emphasis text-
{{ $type->text() }}
</a>
<p class="small opacity-50 fw-normal m-0">
{{ trans_choice('{1} :count пакет|[2,4] :count пакета|:count пакетов', \App\Models\Package::approved()->where('type', $type)->count()) }}
@php
$count = \App\Models\Package::approved()->where('type', $type)->count();
$forms = ['пакет', 'пакета', 'пакетов'];
$form = $forms[($count % 100 > 4 && $count % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][min($count % 10, 5)]];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Разве не достаточно будет указать явно диапазон:

{{ trans_choice('{1} :count пакет|[2,4] :count пакета|[5,*] :count пакетов', \App\Models\Package::approved()->where('type', $type)->count()) }}

Copy link
Author

@solv1k solv1k Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет. Сначала я именно так и сделал. Но, как оказалось - нет)

@endphp
{{ $count }} {{ $form }}
</p>
</div>
</div>
Expand Down