CodeIgniter Forums

Full Version: Problem in language load()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]starbbs[/eluser]
In the language file, there is still a problem with the load() function. What happens if a user want to switch languages inside his preferences ?

Code:
if (in_array($langfile, $this->is_loaded, TRUE))
{
return;
}

doesnt this code prevents to load a other language file ? because it already loaded say: the english in stead of the french ?

El Forum

[eluser]starbbs[/eluser]
After a quick look at the new version, i saw that there is still a loading problem inside the language file. This prevents to load a new language after a language was already loaded. Say someone in his preferences, has setup to load the english language. Online, he decided to switch to german, than the load() function prevents that:

Code:
if (in_array($langfile, $this->is_loaded, TRUE))
{
  return;
}

This code checks if a language file was already loaded. If so, it returns.

A possible simple fix is to add the directory name into the is_loaded() array. This way you can change directory's.

so in stead:

Code:
$this->is_loaded[] = $langfile;

change to:

Code:
$this->is_loaded[] = $idiom.'/'.$langfile;