Welcome Guest, Not a member yet? Register   Sign In
Language problem
#1

[eluser]Alix.G[/eluser]
Hey, I have some trouble changing the language item of the config file, it seems that it's changing but it's not retrieving the right language.

Here what I have done to test it:

In one of my controller I created a function
Code:
function french()
    {
        echo $this->config->item('language').'<br />'.$this->lang->line('admin_products').'<br /><br />';
        $this->config->set_item('language', 'french');
        echo $this->config->item('language').'<br />'.$this->lang->line('admin_products').'<br /><br />';
    }

// output :
//
//english
//products
//
//french
//products

Thanks for your help
#2

[eluser]WanWizard[/eluser]
Setting the language doesn't reload loaded language files.

You have to either set the correct language as early as possible in the page request process, before language files are loaded, or reload all loaded language files after a switch of language.
#3

[eluser]Alix.G[/eluser]
What would you recommend (without using uri language solution)? And how do I reload the language files?

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB