CodeIgniter Forums
Change autoloaded languages? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Change autoloaded languages? (/thread-43179.html)



Change autoloaded languages? - El Forum - 07-03-2011

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


Change autoloaded languages? - El Forum - 07-03-2011

[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


Change autoloaded languages? - El Forum - 07-03-2011

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


Change autoloaded languages? - El Forum - 07-03-2011

[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


Change autoloaded languages? - El Forum - 07-03-2011

[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


Change autoloaded languages? - El Forum - 07-09-2011

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


Change autoloaded languages? - El Forum - 07-09-2011

[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