Custom admin modules Language files are not detected
dgvirtual opened this issue · comments
I have created a Language/en/Pages.php
file in my app/Modules/Pages
module, but I could not access the strings from that file using the lang('Pages.pageTitle')
function. But when I moved the Pages.php
file to app/Languages/en/
, it started to work.
So I assume the modules functionality is incomplete and does not pick up the languages files.
I am using the current Bonfire2 code.
Making the language files detectable turned out to be actually as simple as adding App\Modules\Pages
to $psr4
array in app/Config/Autoload.php
:
public $psr4 = [
APP_NAMESPACE => APPPATH,
'Config' => APPPATH . 'Config',
'App\Modules\Pages' => APPPATH . 'Modules/Pages',
];
Adding only 'App\Modules' => APPPATH . 'Modules',
did not do the trick. So, this should be done for each individual module. Seems not to be ideal, but manageable. Perhaps the documentation should be updated to include this, unless a more automatic solution is created.
Fixed by PR #332