Laravel-Lang / lang

List of 126 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova, Laravel Spark and Laravel UI.

Home Page:https://laravel-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 in resources/lang
  • Modify locale in config/app.php to fr
  • Go to /login and maybe get Log in instead of Connexion

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. 😄