Relevant configuration : Php version 8 - laravel 8.
I have been trying to use laravel json translation without success and I don't understand how to make it work. The normal way using shorkeys works just fine as shown in the output below (pictures).
dashboard.blade.php :
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Dashboard') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
You're logged in! {{ app()->getLocale() ." : " . __('30 Days') }}
</div>
<div class="p-6 bg-white border-b border-gray-200">
You're logged in! {{ app()->getLocale() ." : " . trans('30 Days') }}
</div>
<div class="p-6 bg-white border-b border-gray-200">
You're logged in! {{ app()->getLocale() ." : " . Lang::get('30 Days') }}
</div>
<div class="p-6 bg-white border-b border-gray-200">
You're logged in! {{ app()->getLocale() ." : " . __('auth.failed') }}
</div>
<div class="p-6 bg-white border-b border-gray-200">
You're logged in! {{ app()->getLocale() ." : " . trans('auth.failed') }}
</div>
<div class="p-6 bg-white border-b border-gray-200">
You're logged in! {{ app()->getLocale() ." : " . Lang::get('auth.failed') }}
</div>
</div>
</div>
</div>
auth.php :
return [
'failed' => 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.',
'password' => 'Das eingegebene Passwort ist nicht korrekt.',
'throttle' => 'Zu viele Loginversuche. Versuchen Sie es bitte in :seconds Sekunden nochmal.',
];
de.json :
{
"30 Days": "30 Tage",
"60 Days": "60 Tage",
"90 Days": "90 Tage",
":amount Total": ":amount Gesamt",
...rest of the translations,
}