Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

Laravel Translation Still `en` even if locale changed

i'm trying to change language with laravel but it still en (fallback_locale)

locale changes successfully to another language but laravel still depends on fallback_locale

while changing fallback locale to 'ar' as example, blade prints the key as web.product.name

i tried trans('web.product.name',[],'ar'); in tinker cmd and it works fine

/config/app.php

'locale' => 'ar',
'locales' => ['en', 'ar', 'ku', 'tu'],

php artisan cache:clear does not effect

echo 'locale' anywhere returns what i set but lang still en

question from:https://stackoverflow.com/questions/66065537/laravel-translation-still-en-even-if-locale-changed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Have you tried clearing your cache?

php artisan config:clear

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...