forked from mirrors/easyappointments
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,38 +82,31 @@ $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',
|
'da' => 'danish',
|
||||||
'da' => 'danish',
|
'nl' => 'dutch',
|
||||||
'nl' => 'dutch',
|
'en' => 'english',
|
||||||
'en' => 'english',
|
'fi' => 'finnish',
|
||||||
'fi' => 'finnish',
|
'fr' => 'french',
|
||||||
'fr' => 'french',
|
'de' => 'german',
|
||||||
'de' => 'german',
|
'el' => 'greek',
|
||||||
'el' => 'greek',
|
'hi' => 'hindi',
|
||||||
'hi' => 'hindi',
|
'hu' => 'hungarian',
|
||||||
'hu' => 'hungarian',
|
'it' => 'italian',
|
||||||
'it' => 'italian',
|
'ja' => 'japanese',
|
||||||
'ja' => 'japanese',
|
'pl' => 'polish',
|
||||||
'pl' => 'polish',
|
'pt' => 'portuguese',
|
||||||
'pt' => 'portuguese',
|
'ro' => 'romanian',
|
||||||
'pt' => 'portuguese',
|
'ru' => 'russian',
|
||||||
'ro' => 'romanian',
|
'sk' => 'slovak',
|
||||||
'ru' => 'russian',
|
'es' => 'spanish',
|
||||||
'sk' => 'slovak',
|
'tr' => 'turkish'
|
||||||
'es' => 'spanish',
|
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
||||||
'tr' => 'turkish'
|
: Config::LANGUAGE;
|
||||||
)[substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
|
||||||
:
|
|
||||||
(defined('Config::LANGUAGE')
|
|
||||||
? Config::LANGUAGE
|
|
||||||
: 'english'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue