Skip to content
Snippets Groups Projects
Commit 0239dd07 authored by Bob Le Bricodeur's avatar Bob Le Bricodeur
Browse files

Add environment variable to be able to switch between languages using Windows

parent 7cee5490
No related branches found
No related tags found
No related merge requests found
......@@ -37,15 +37,17 @@ if (isset($_POST['lang']) && is_string($_POST['lang']) && in_array($_POST['lang'
}
$locale = $mlocale . '.utf8';//unix format
if (strtoupper(substr(PHP_OS,0,3))=='WIN'){ //windows locale format, see http://msdn.microsoft.com/en-us/library/39cwe7zf%28v=vs.90%29.aspx
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;
case 'en_GB' : $locale = "english";break;
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=');
putenv('LANGUAGE=');//sert à quoi?
setlocale(LC_ALL, $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_MESSAGES, $locale);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment