I have changed the default website localization in confing/app.php to be (de)
'locale' => 'de',
'fallback_locale' => 'de',
But still website is loading in 'en' localization .
I tried clearing the view cache and cache but nothing changed .
I am using https://github.com/mcamara/laravel-localization
The de will be activate only when i use the URL domainname.com/de
In the scenario to not be using the dynamic locale in the URL it seems you will have to adjust the configuration file for this package:
'useAcceptLanguageHeader' => false,
From the comments for that variable:
"Negotiate for the user locale using the Accept-Language header if it's not defined in the URL? If false, system will take app.php locale attribute"
Seems to get it to use that default you have to set this to false.
You could play with the other variable:
'hideDefaultLocaleInURL' => true,
to see how that adjusts the default behavior as well.
i had the same proplem go to laravellocalization.php in config
and make
'useAcceptLanguageHeader' => false,
and then run
php artisan config:clear
and it will work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With