• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change autoloaded languages?


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
$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?

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



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).

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.


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.


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

=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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.