Merge pull request #6 from pascalchevrel/issue1-gettextparameter

fix issue 1 : permet de faire fonctionner gettext avec le serveur de dev...
This commit is contained in:
pyg77 2013-03-04 10:21:19 -08:00
commit 51cefeb7f9
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,4 @@
<?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]);
$_SESSION['langue'] = strtoupper($a[0]);