Corrected issue with language resolving on an API request.

This commit is contained in:
Alex Tselegidis 2020-03-27 11:00:54 +01:00
parent ca989d01fa
commit 3c4ecb2873

View file

@ -82,9 +82,8 @@ $config['url_suffix'] = '';
|
*/
$config['language'] = (null !== $_SERVER['HTTP_ACCEPT_LANGUAGE']
?
array(
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?
[
'ar' => 'arabic',
'bu' => 'bulgarian',
'zh' => 'chinese',
@ -101,19 +100,13 @@ $config['language'] = (null !== $_SERVER['HTTP_ACCEPT_LANGUAGE']
'ja' => 'japanese',
'pl' => 'polish',
'pt' => 'portuguese',
'pt' => 'portuguese',
'ro' => 'romanian',
'ru' => 'russian',
'sk' => 'slovak',
'es' => 'spanish',
'tr' => 'turkish'
)[substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
:
(defined('Config::LANGUAGE')
? Config::LANGUAGE
: 'english'
)
);
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
: Config::LANGUAGE;
/*
|--------------------------------------------------------------------------