Level 4
Found the issue
public function boot()
{
...
$this->loadTranslationsFrom(__DIR__.'/Resources/lang', 'aaa');
...
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
Using laravel 5.8
I am trying to load translations in a module I am making, but I am getting no luck. Really annoying... I must be missing something but I can not see it.
service provider file
public function boot()
{
...
$this->loadTranslationsFrom(__DIR__.'/Resources/lang/en', 'aaa');
...
}
admin_pages.php
return [
"welcome" => "Hello"
];
view
{{ __('aaa::admin_pages.welcome') }}
@lang('aaa::admin_pages.welcome')
controller
echo trans('aaa::admin_pages.welcome');
echo trans('*::admin_pages.welcome');
I don't know where this are going wrong here.
As a result my views display the text entered in the quotes aaa::admin_pages.welcome*::manage_logs.title
no translations. Is there a way to debug what is loaded?
Found the issue
public function boot()
{
...
$this->loadTranslationsFrom(__DIR__.'/Resources/lang', 'aaa');
...
}
Please or to participate in this conversation.