$v ) { if (substr($k,0,2)==substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) { $mlocale = $k; } } } $locale = $mlocale . '.utf8';//unix format if (strtoupper(substr(PHP_OS,0,3))=='WIN'){ putenv("LC_ALL=$mlocale"); //Windows env. needed to switch between languages switch ($mlocale){ case 'fr_FR' : $locale = "fra";break; //$locale in windows locale format, needed to use php function that handle text : strftime() case 'en_GB' : $locale = "english";break; //see http://msdn.microsoft.com/en-us/library/39cwe7zf%28v=vs.90%29.aspx case 'de_DE' : $locale = "deu";break; case 'es_ES' : $locale = "esp";break; } } putenv('LANGUAGE=');//sert à quoi? setlocale(LC_ALL, $locale); setlocale(LC_TIME, $locale); //setlocale(LC_MESSAGES, $locale); $domain = 'Studs'; bindtextdomain($domain, 'locale'); bind_textdomain_codeset($domain, 'UTF-8'); textdomain($domain); /* temp, for compatibility :*/ $a = explode('_', $mlocale); $_SESSION['langue'] = strtoupper($a[0]); /* */ $lang = ($_SESSION['langue']!='') ? strtolower($_SESSION['langue']) : 'fr'; /* Date Format */ $date_format['txt_full'] = _("%A, den %e. %B %Y"); //summary in choix_date.php and removal date in choix_(date|autre).php $date_format['txt_short'] = "%A %e %B %Y"; // radio title $date_format['txt_day'] = "%a %e"; if (strtoupper(substr(PHP_OS,0,3))=='WIN'){ //%e can't be used on Windows platform, use %#d instead foreach($date_format as $k => $v) { $date_format[$k] = preg_replace('#(?