Name dynamic translation keys the way the catalogue test reads them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 11:31:47 +02:00
parent 9f970808ca
commit d80ed1a3e8
6 changed files with 10 additions and 10 deletions

View File

@@ -88,7 +88,7 @@ class ApplicationInfolist
->state(fn (ApplicationReply $record) => __('panel.replies.by', [ ->state(fn (ApplicationReply $record) => __('panel.replies.by', [
'name' => $record->user_name ?? '—', 'name' => $record->user_name ?? '—',
'when' => $record->created_at?->isoFormat('LLL'), 'when' => $record->created_at?->isoFormat('LLL'),
]).' · '.__('panel.replies.channels.'.$record->channel)) ]).' · '.__("panel.replies.channels.{$record->channel}"))
->color('gray'), ->color('gray'),
TextEntry::make('body') TextEntry::make('body')

View File

@@ -32,7 +32,7 @@ class ExpiringSoon extends Notification
return FilamentNotification::make() return FilamentNotification::make()
->title(trans_choice('panel.expiring.notification.title', $this->items->count(), ['count' => $this->items->count()])) ->title(trans_choice('panel.expiring.notification.title', $this->items->count(), ['count' => $this->items->count()]))
->body($this->items ->body($this->items
->map(fn (array $item) => $item['title'].' — '.__('panel.expiring.events.'.$item['event'], [ ->map(fn (array $item) => $item['title'].' — '.__("panel.expiring.events.{$item['event']}", [
'when' => $item['at']->diffForHumans(), 'when' => $item['at']->diffForHumans(),
'date' => $item['at']->isoFormat('LL'), 'date' => $item['at']->isoFormat('LL'),
])) ]))

View File

@@ -35,7 +35,7 @@
<div class="ec-legend" aria-label="{{ __('panel.calendar.legend') }}"> <div class="ec-legend" aria-label="{{ __('panel.calendar.legend') }}">
@foreach (['published', 'scheduled', 'unpublishes', 'opens', 'closes'] as $event) @foreach (['published', 'scheduled', 'unpublishes', 'opens', 'closes'] as $event)
<span class="ec-event ec-{{ $event }}">{{ __('panel.calendar.events.'.$event) }}</span> <span class="ec-event ec-{{ $event }}">{{ __("panel.calendar.events.{$event}") }}</span>
@endforeach @endforeach
</div> </div>
@@ -73,8 +73,8 @@
@foreach ($day['events'] as $event) @foreach ($day['events'] as $event)
<a href="{{ $event['url'] }}" class="ec-event ec-{{ $event['event'] }}"> <a href="{{ $event['url'] }}" class="ec-event ec-{{ $event['event'] }}">
<span class="sr-only">{{ __('panel.calendar.events.'.$event['event']) }}:</span> <span class="sr-only">{{ __("panel.calendar.events.{$event['event']}") }}:</span>
{{ __('panel.calendar.types.'.$event['type']) }} · {{ $event['title'] }} {{ __("panel.calendar.types.{$event['type']}") }} · {{ $event['title'] }}
</a> </a>
@endforeach @endforeach
</div> </div>

View File

@@ -70,7 +70,7 @@
{{ $row['title'] }} {{ $row['title'] }}
@endif @endif
</td> </td>
<td>{{ __('panel.statistics.types.'.$row['type']) }}</td> <td>{{ __("panel.statistics.types.{$row['type']}") }}</td>
<td class="num">{{ number_format($row['views'], 0, ',', '.') }}</td> <td class="num">{{ number_format($row['views'], 0, ',', '.') }}</td>
<td @class(['num', 'st-up' => str_starts_with($delta, '+'), 'st-down' => str_starts_with($delta, '−')])>{{ $delta }}</td> <td @class(['num', 'st-up' => str_starts_with($delta, '+'), 'st-down' => str_starts_with($delta, '−')])>{{ $delta }}</td>
</tr> </tr>
@@ -88,7 +88,7 @@
<ul class="st-unread"> <ul class="st-unread">
@foreach ($unread as $row) @foreach ($unread as $row)
<li> <li>
<x-filament::badge color="gray" size="sm" style="display: inline-flex">{{ __('panel.statistics.types.'.$row['type']) }}</x-filament::badge> <x-filament::badge color="gray" size="sm" style="display: inline-flex">{{ __("panel.statistics.types.{$row['type']}") }}</x-filament::badge>
@if ($row['url']) @if ($row['url'])
<x-filament::link :href="$row['url']">{{ $row['title'] }}</x-filament::link> <x-filament::link :href="$row['url']">{{ $row['title'] }}</x-filament::link>
@else @else

View File

@@ -40,7 +40,7 @@
@foreach ($pending as $item) @foreach ($pending as $item)
<tr> <tr>
<td> <td>
<x-filament::badge color="gray" size="sm" style="display: inline-flex">{{ __('panel.statistics.types.'.$item['type']) }}</x-filament::badge> <x-filament::badge color="gray" size="sm" style="display: inline-flex">{{ __("panel.statistics.types.{$item['type']}") }}</x-filament::badge>
{{ $item['title'] }} {{ $item['title'] }}
</td> </td>
<td> <td>

View File

@@ -9,7 +9,7 @@
<li class="flex flex-wrap items-center justify-between gap-2 py-2"> <li class="flex flex-wrap items-center justify-between gap-2 py-2">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<x-filament::badge :color="$item['event'] === 'closes' ? 'warning' : 'gray'"> <x-filament::badge :color="$item['event'] === 'closes' ? 'warning' : 'gray'">
{{ __('panel.expiring.types.'.$item['type']) }} {{ __("panel.expiring.types.{$item['type']}") }}
</x-filament::badge> </x-filament::badge>
<x-filament::link :href="$item['url']"> <x-filament::link :href="$item['url']">
@@ -18,7 +18,7 @@
</div> </div>
<span class="text-sm text-gray-500 dark:text-gray-400"> <span class="text-sm text-gray-500 dark:text-gray-400">
{{ __('panel.expiring.events.'.$item['event'], ['when' => $item['at']->diffForHumans(), 'date' => $item['at']->isoFormat('LL')]) }} {{ __("panel.expiring.events.{$item['event']}", ['when' => $item['at']->diffForHumans(), 'date' => $item['at']->isoFormat('LL')]) }}
</span> </span>
</li> </li>
@endforeach @endforeach