mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 01:52:22 +03:00
Corrected issue with language resolving on an API request.
This commit is contained in:
parent
ca989d01fa
commit
3c4ecb2873
1 changed files with 25 additions and 32 deletions
|
@ -82,9 +82,8 @@ $config['url_suffix'] = '';
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$config['language'] = (null !== $_SERVER['HTTP_ACCEPT_LANGUAGE']
|
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?
|
||||||
?
|
[
|
||||||
array(
|
|
||||||
'ar' => 'arabic',
|
'ar' => 'arabic',
|
||||||
'bu' => 'bulgarian',
|
'bu' => 'bulgarian',
|
||||||
'zh' => 'chinese',
|
'zh' => 'chinese',
|
||||||
|
@ -101,19 +100,13 @@ $config['language'] = (null !== $_SERVER['HTTP_ACCEPT_LANGUAGE']
|
||||||
'ja' => 'japanese',
|
'ja' => 'japanese',
|
||||||
'pl' => 'polish',
|
'pl' => 'polish',
|
||||||
'pt' => 'portuguese',
|
'pt' => 'portuguese',
|
||||||
'pt' => 'portuguese',
|
|
||||||
'ro' => 'romanian',
|
'ro' => 'romanian',
|
||||||
'ru' => 'russian',
|
'ru' => 'russian',
|
||||||
'sk' => 'slovak',
|
'sk' => 'slovak',
|
||||||
'es' => 'spanish',
|
'es' => 'spanish',
|
||||||
'tr' => 'turkish'
|
'tr' => 'turkish'
|
||||||
)[substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
||||||
:
|
: Config::LANGUAGE;
|
||||||
(defined('Config::LANGUAGE')
|
|
||||||
? Config::LANGUAGE
|
|
||||||
: 'english'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue