Support the ongoing development of Laravel.io →
posted 6 years ago

Hello, my default configured locale in app.php is en. Now in my controller I do:

App::setLocale('it');

which is working, because if I look at the page source I can see

<html lang="it">

then I created the resource/lang/it folder, with a messages.php file returning the translations, but it's not working. In my template I have:

{{ __('Round') }}

which remains Round even if in my messages.php I have:

return [
    'Round' => 'Giocata',
];

any hint? thanks a lot

Last updated 2 years ago.
0

Hello! In your blade file, you must reference the file name (messages):

{{ __('messages.Round') }}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

andrea giorg Joined 13 Sep 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.