mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-28 01:22:25 +03:00
Load the booking frontend in the primary language of the client's browser unless it is overridden by manual language selection.
This commit is contained in:
parent
14bbd793bf
commit
6b39b121b6
1 changed files with 32 additions and 1 deletions
|
@ -82,7 +82,38 @@ $config['url_suffix'] = '';
|
|||
|
|
||||
*/
|
||||
|
||||
$config['language'] = defined('Config::LANGUAGE') ? Config::LANGUAGE : 'english';
|
||||
$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'
|
||||
)
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue