CodeIgniter Forums
Special Character - 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: Special Character (/showthread.php?tid=52340)

Pages: 1 2


Special Character - El Forum - 06-06-2012

[eluser]dnc[/eluser]
Have you reconfigured your lang in config ['language']?
Have you did anything to change the default behavior?


Do you have another browser that you can test it it in?


Special Character - El Forum - 06-06-2012

[eluser]dnc[/eluser]
As I stated something has changed in the charset ??


My first guess... You are working with the language class correct or incorrect?


Special Character - El Forum - 06-06-2012

[eluser]ibnclaudius[/eluser]
No.

"My first guess… You are working with the language class correct or incorrect?"
What you mean?


Special Character - El Forum - 06-06-2012

[eluser]dnc[/eluser]
What is the value of

Code:
$config['language']=;


Again how are you returning the user language? Browser => session
DataBase=> Server SIDE


And what is the language set of your browser?





Special Character - El Forum - 06-06-2012

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