Skip to content
Snippets Groups Projects
Commit db05126f authored by pascalc's avatar pascalc
Browse files

fix issue 1 : permet de faire fonctionner gettext avec le serveur de dev de...

fix issue 1 : permet de faire fonctionner gettext avec le serveur de dev de PHP5.4 + enlève code commenté depuis des années
parent f7efca43
No related branches found
No related tags found
No related merge requests found
<?php
//$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (isset($_GET['lang']) && is_string($_GET['lang']) && in_array($_GET['lang'], array_keys($ALLOWED_LANGUAGES)) ) {
$mlocale = $_GET['lang'] ;
......@@ -11,6 +10,7 @@ if (isset($_GET['lang']) && is_string($_GET['lang']) && in_array($_GET['lang'],
}
$locale = $mlocale . '.utf8';
putenv('LANGUAGE=');
setlocale(LC_ALL, $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_MESSAGES, $locale);
......@@ -22,4 +22,4 @@ textdomain($domain);
/* temp, for compatibility :*/
$a = explode('_', $locale);
$_SESSION['langue'] = strtoupper($a[0]);
\ No newline at end of file
$_SESSION['langue'] = strtoupper($a[0]);
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