Include language array in Codeigniter 4
I receive the "language segment" from the url (I use CodeIgniter 4)
I would like to load the relative translations array in the controller ready for the view... so I tried:
$data['tran'] = array(require_once(APPPATH."/Language/en/file_lang.php"));
<?php //english $lang = array(); $lang['t1'] = "Description"; $lang['t2'] = "list"; $lang['t3'] = "Contact"; $lang['t4'] = "Write"; $lang['t5'] = "Views"; $lang['t6'] = "Cities";
In my view
I receive this error: Undefined index: t1
Does not work... why?