HTTP_ACCEPT_LANGUAGE is not set when executing the app from the console.

This commit is contained in:
Alex Tselegidis 2021-06-14 10:21:43 +02:00
parent 4f0b2c6c8f
commit dfdbea6214

View file

@ -113,7 +113,7 @@ $languages = [
'tr' => 'turkish', 'tr' => 'turkish',
]; ];
$language_code = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); $language_code = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : 'en';
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages[$language_code]) $config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages[$language_code])
? $languages[$language_code] ? $languages[$language_code]