CodeIgniter Forums
Creating a multilingual website - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Creating a multilingual website (/showthread.php?tid=53008)



Creating a multilingual website - El Forum - 07-06-2012

[eluser]Mahn[/eluser]
Hello,

I'm having some problems in creating a multilingual website. I have all of my language files ready in separate folders inside the application/language folder. For every bit of text on the webiste, I'm doing
Code:
echo lang('general_welcome_message');

So now I want to give users the option to change language and store that in a cookie.

Any ideas on how I should go about doing that?

Thanks!


Creating a multilingual website - El Forum - 07-06-2012

[eluser]WanWizard[/eluser]
Code:
$this->config->set_item('language', 'your_language_here');
before you load any language files. You can fetch that value from a cookie if you want, or from the session.