Set default locale for the intl extension upon locale detection

refs #6778
This commit is contained in:
Eric Lippmann 2015-04-10 09:29:46 +02:00
parent 0baeb32751
commit 06830e035e

View File

@ -3,6 +3,7 @@
namespace Icinga\Util; namespace Icinga\Util;
use Locale;
use Icinga\Exception\IcingaException; use Icinga\Exception\IcingaException;
/** /**
@ -173,7 +174,9 @@ class Translator
$localeName $localeName
); );
} }
Locale::setDefault(static::DEFAULT_LOCALE);
} else { } else {
Locale::setDefault($localeName);
$locale = setlocale(LC_ALL, 0); $locale = setlocale(LC_ALL, 0);
putenv('LC_ALL=' . $locale); // Failsafe, Win and Unix putenv('LC_ALL=' . $locale); // Failsafe, Win and Unix
putenv('LANG=' . $locale); // Windows fix, untested putenv('LANG=' . $locale); // Windows fix, untested