Welcome Guest, Not a member yet? Register   Sign In
Changed language is overriden
#1

[eluser]Kamape[/eluser]
Hi!

I've created a hook that's checking the session parameter 'language' and updates it with default language if it's not specified. Then this parameter is updating the config['language'] parameter so that correct language will be loaded.

However, when I'm dumping the session and the config language item they both is specifiying the correct language, but when using $this->lang->line or lang() it's still using the language value specified in the config.php file.

The hook is placed as post_controller_constructor.

Any idea why it's overriding? Should I place the hook in some other point?
#2

[eluser]Kamape[/eluser]
Found out that it was because I was loading the language file in autoload and therefore it was processed before the config->item('language') was updated with session info.

Guess I'll have to place the language load in the method instead.




Theme © iAndrew 2016 - Forum software by © MyBB