[eluser]dnc[/eluser]
I have written a function that detects the users language based on 2 digit lang code posted from PHP from the browser.
Now you have to name all language files the 2 digit codes including the system folder.
Now most say 'yea right MOFO'
But can detect and redirect back to English is not detected.....
YES Simple, but, effective so .....
hers is how I partially do this as to not make a Wiki out of the situation;
Code:
/*
* Place In your config file overwriting
$config['language']
* Courtesy would be nice in your source, but not required.
* Courtesy Bill Anderson : use it now or later
@ as POSTED ON : http://ellislab.com/forums/viewthread/218776/
*/
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if(isset ($lang) && file_exists(APPPATH . 'language/'.$lang )) {
$config['language'] = $lang;
}
else {
$config['language'] = 'en';
}
And then name all language folders the 2 letter code returned from PHP including system files which would overridde CI language file system from the start.