1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| function loadGlobalLang(){
$langue = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
switch ($langue[0]){
case 'en':
$langue = 'en';
break;
case 'fr':
$langue = 'fr';
break;
case 'de':
$langue = 'de';
break;
case 'es':
$langue = 'es';
break;
default:
$langue = 'en';
}
if (empty($_SESSION['strLangue']) || !empty($_GET['strLangue'])) {
$_SESSION['strLangue'] = empty($_GET['strLangue']) ? $langue : $_GET['strLangue'];
}else{
if (isset($_GET['strLangue'])) {
$_GET['strLangue'] = 'fr';
}
}
} |
Partager