Skip to content
Snippets Groups Projects
Commit 51cefeb7 authored by pyg77's avatar pyg77
Browse files

Merge pull request #6 from pascalchevrel/issue1-gettextparameter

fix issue 1 : permet de faire fonctionner gettext avec le serveur de dev...
parents f7efca43 db05126f
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