CodeIgniter Forums

Full Version: Change autoloaded languages?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ev0c[/eluser]
Hi,

i'm using CIs Language class / helper for providing a multilanguage website. Everything works fine when i load the language files i need in every controller.
But i have some lang files i don't want to load every time because they should be avaiable globally. Therfore i autoloaded (autoload.php) these.

I thought because
Code:
$this->->config->set_item('language', $lang);
is changing the core language (form_validation ...) it would also autoload the specific language file in the other given language. But that's not the case -> it remains in the language like it was before the language change.

Am i doing something wrong?

El Forum

[eluser]InsiteFX[/eluser]
You need to copy the language files that you need from system/language then modify them for the language that you need. Then place them in application/language/language_name

application/
english
german
french
etc.

InsiteFX

El Forum

[eluser]ev0c[/eluser]
Yes i did this. Maybe i should write my question a little different:

The autoload.php loads one of my language files globally (but in the default language, defined in the config). When changing this default language in the controller it has no effect on the autoloaded language file.

How can i change this since i want to autoload that again in the specific language (without writing it explicit in the controller every time).

El Forum

[eluser]InsiteFX[/eluser]
You would need to use a CodeIgniter hook, the best way to see how to do this is do download like PyroCMS and see how they are doing it.

InsiteFX

El Forum

[eluser]ev0c[/eluser]
Okay thanks. I looked into it but it was not exactly what i was looking for. I found this thread: http://ellislab.com/forums/viewthread/64118/#339962

That solved my problem.


Thanks

El Forum

[eluser]adityamenon[/eluser]
Why are you having a username that only has one meaning? I'm not offended, it's just funny Big Grin

El Forum

[eluser]ev0c[/eluser]
=D ... trust me that was not my intention. I actually never heard of it and while thinking of a username it just randomly came to my mind. I changed it. xD