Merge pull request #1070 from ArthurHoaro/hotfix/lc-messages-warning
Use LC_COLLATE instead of LC_MESSAGES if php-intl is not installed
This commit is contained in:
commit
40e816e379
2 changed files with 7 additions and 0 deletions
|
@ -69,6 +69,8 @@ public function __construct($language, $conf)
|
||||||
{
|
{
|
||||||
$this->conf = $conf;
|
$this->conf = $conf;
|
||||||
$confLanguage = $this->conf->get('translation.language', 'auto');
|
$confLanguage = $this->conf->get('translation.language', 'auto');
|
||||||
|
// Auto mode or invalid parameter, use the detected language.
|
||||||
|
// If the detected language is invalid, it doesn't matter, it will use English.
|
||||||
if ($confLanguage === 'auto' || ! $this->isValidLanguage($confLanguage)) {
|
if ($confLanguage === 'auto' || ! $this->isValidLanguage($confLanguage)) {
|
||||||
$this->language = substr($language, 0, 5);
|
$this->language = substr($language, 0, 5);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -124,6 +124,11 @@
|
||||||
$conf = new ConfigManager();
|
$conf = new ConfigManager();
|
||||||
$sessionManager = new SessionManager($_SESSION, $conf);
|
$sessionManager = new SessionManager($_SESSION, $conf);
|
||||||
|
|
||||||
|
// LC_MESSAGES isn't defined without php-intl, in this case use LC_COLLATE locale instead.
|
||||||
|
if (! defined('LC_MESSAGES')) {
|
||||||
|
define('LC_MESSAGES', LC_COLLATE);
|
||||||
|
}
|
||||||
|
|
||||||
// Sniff browser language and set date format accordingly.
|
// Sniff browser language and set date format accordingly.
|
||||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||||
autoLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
autoLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
|
|
Loading…
Reference in a new issue