mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 14:42:23 +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,38 +82,31 @@ $config['url_suffix'] = '';
|
|||
|
|
||||
*/
|
||||
|
||||
$config['language'] = (null !== $_SERVER['HTTP_ACCEPT_LANGUAGE']
|
||||
?
|
||||
array(
|
||||
'ar' => 'arabic',
|
||||
'bu' => 'bulgarian',
|
||||
'zh' => 'chinese',
|
||||
'da' => 'danish',
|
||||
'nl' => 'dutch',
|
||||
'en' => 'english',
|
||||
'fi' => 'finnish',
|
||||
'fr' => 'french',
|
||||
'de' => 'german',
|
||||
'el' => 'greek',
|
||||
'hi' => 'hindi',
|
||||
'hu' => 'hungarian',
|
||||
'it' => 'italian',
|
||||
'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'
|
||||
)
|
||||
);
|
||||
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?
|
||||
[
|
||||
'ar' => 'arabic',
|
||||
'bu' => 'bulgarian',
|
||||
'zh' => 'chinese',
|
||||
'da' => 'danish',
|
||||
'nl' => 'dutch',
|
||||
'en' => 'english',
|
||||
'fi' => 'finnish',
|
||||
'fr' => 'french',
|
||||
'de' => 'german',
|
||||
'el' => 'greek',
|
||||
'hi' => 'hindi',
|
||||
'hu' => 'hungarian',
|
||||
'it' => 'italian',
|
||||
'ja' => 'japanese',
|
||||
'pl' => 'polish',
|
||||
'pt' => 'portuguese',
|
||||
'ro' => 'romanian',
|
||||
'ru' => 'russian',
|
||||
'sk' => 'slovak',
|
||||
'es' => 'spanish',
|
||||
'tr' => 'turkish'
|
||||
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
||||
: Config::LANGUAGE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue