Originally by Jérôme Jaglale. Also based on cimet ideas.
Just copy the files to your /application folder. Set available languages on /application/config/i18n.php
Each method is documented.
Get the current language: $this->lang->lang();
Switch to another language: anchor($this->lang->switch_uri('es'),'Display current page in Spanish');
When there's no language set on the URL, we'll try to autoguess user's language. On each request, the browser send info on their language preferences. The library checks that info ($_SERVER['HTTP_ACCEPT_LANGUAGE']) and tries to guess which language to use.