Welcome Guest, Not a member yet? Register   Sign In
$config['language'] - how to change it on the fly?
#1

[eluser]notset[/eluser]
Hello,

How to change default language when the script is running?

For example, if have more than one language, i don't know which is selected. So, when i use validation class, all errors are shown in $config['language'] which have to be specified in the config file. Can i change it on the fly?

Thank's.

Quote:/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = "english";
#2

[eluser]ejangi[/eluser]
You've got a couple of options here. You can load a particular language file:
Code:
$this->lang->load('filename', 'language');
or you can set the config item on the fly:
Code:
$this->config->set_item('item_name', 'item_value');

I've never actually tried to load a different language on the fly unfortunately, but see what a combination of the above does.




Theme © iAndrew 2016 - Forum software by © MyBB