Welcome Guest, Not a member yet? Register   Sign In
Loading incorrect language.


I have the following code:
public function loadLangFile($lang='hungarian') {
  $toLoad = array('common', 'error', 'menu');
  $data = $this->lang->load($toLoad, $lang, TRUE);

  return $data;
Which should load the files common_lang.php, error_lang.php, and menu_lang.php from within the language/hungarian directory.

However my issue is that it doesn't. It tries to load from within the english directory spitting out this error:
Quote:Unable to load the requested language file: language/english/common_lang.php

If I remove the array and only put one of the language files, it loads fine.
$data = $this->lang->load('common', $lang, TRUE);

Furthermore, the Lang.php file which contains the load method says the first param can be an array.
Quote:@param mixed the name of the language file to be loaded. Can be an array

Unfortunately I can't debug the code for I keep getting a 'Disallowed Key Characters' error when trying to debug in my IDE.

Any help or tips on this matter would be appreciated.

Thank you! Smile

Found the solution.

The problem was within the Modular Extensions - HMVC file.

changed the MX_Lang class
foreach($langfile as $_lang) $this->load($_lang);

foreach($langfile as $_lang) $this->load($_lang, $lang);

Theme © iAndrew 2016 - Forum software by © MyBB