How is it not working? Are you gettin an error or does it show in english?
If you config is cached try running
php artisan config:clear
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i'm set default language ar but not worjing
'fallback_locale' => 'ar',
How is it not working? Are you gettin an error or does it show in english?
If you config is cached try running
php artisan config:clear
i make this command .. not get error but show English language as default and change to Arabic is working
Did you change this one as well? Did you remember to create all the needed translations in /resources/lang ?
'locale' => 'ar',
yes i make all of this and translation work perfectly when change language form ar to en
and vice versa.. but my problem is can's set ar default
Ok. Its just that you started out with fallback_locale, which is what to use if the translation does not exist on the selected language.
Can you try and run php artisan tinker and then run this (they should both return 'ar')
config('app.locale');
and
App::getLocale()
Change fallback_locale to your language, It will work
@yeshi Why have you bumped a year-old topic to post a (wrong) reply?
/*
|--------------------------------------------------------------------------
| 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' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
Fallback is if the current locale being used does not exists. Normal locale is the default language, if u want ar to be default, set it in the locale
In my case, the lang.json file was in the wrong folder. It must be in the resources/lang folder to locale work properly.
Please or to participate in this conversation.