Quantcast
Channel: XOOPS Web Application System :: Forum
Viewing all articles
Browse latest Browse all 141

Auto Detect Language [by timgno]

$
0
0
Xoops Development::Auto Detect Language
Hi All!

To Core Team...!!!

In the file session.php, I've noticed in a variable 'securityLevel', the possibility of implement this hack.

The likely source code could be this:

$lang substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 02);
$langConfig = array("en" => "english/""it" => "italian/"
                            
"de" => "deutsch/""fr" => "french/"
                            
"default" => "english/");
if(
array_key_exists($lang$langConfig)) {
    
$language $langConfig[$lang];
} else {
    
$language $langConfig['default'];
}
header('Location: ' $language);

Viewing all articles
Browse latest Browse all 141

Trending Articles