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:
commit
51cefeb7f9
4
i18n.php
4
i18n.php
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user