Welcome Guest, Not a member yet? Register   Sign In
How to load different language at real time?
#1

[eluser]mihu[/eluser]
I would like to provide multiple languages capability.

The way I did is loading the language within constructor.
Code:
$this->load->library('text');

// ... get language option from user

$this->lang->load('xxx', $language);

However, this will not work for some class like validation, since it's codeigniter library.
Is there anyway to load the system language on demand for core library?

Best,

Thanks in advance.
#2

[eluser]Developer13[/eluser]
I think that should work provided you have the specified CI language files installed in system/language... at least this is what makes sense to me off the top of my head.
#3

[eluser]Pascal Kriete[/eluser]
You can dynamically set the language config item, which will then be used as the default throughout the application:

Code:
$this->config->set_item('language', $theuserslanguage);
#4

[eluser]mihu[/eluser]
@Developer13

I did provided the language file which I download from CodeIgniter site.
Thanks for response.

@pascal Kriete

Thanks so much. This works.




Theme © iAndrew 2016 - Forum software by © MyBB