Translations of [fr.json] cannot be found
Akecel opened this issue · comments
- Laravel-Lang Version: 10.1
- PHP Version: 8.0
Description:
I just started a new Laravel project with Jetstream.
So I got the fr
folder from the package that I integrated in the folder resources/lang
I then modified my config/app.php
file :
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'fr',
At this stage the translations should be functional, however, I have translated only the php files (auth, validation, ...) but not the one contained in fr.json
.
I use this syntax (which is basic in JetStream) :
{{ __('Log in') }}
And that display Log in
instead of Connexion
(It does this for all the translations in this file)
I also tried with @lang
and trans()
but nothing works.
Another things that I tried :
- Cache clear
- Config clear
- View clear
- Optimize clear
I hope someone has already had this problem and despite my research, nothing seems to work, any idea?
Thanks in advance !
Steps To Reproduce:
- New Laravel project
- Install JetStream (Blade + Livewire)
- composer require laravel-lang/lang
- Copy the
fr
folder from the package inresources/lang
- Modify locale in
config/app.php
tofr
- Go to
/login
and maybe getLog in
instead ofConnexion
You must put the file fr.json
out of the folder fr
.
if you copied the folder fr
into resources/lang
, move the file fr.json
from resources/lang/fr/fr.json
to resources/lang/fr.json
.
I hope that this works!
Oh, it does work! Thank you very much for your help. 😄