mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-29 03:12:39 +03:00
Merge pull request #662 from yrammos/auto-select-browser-lang
Automatically detect the client's language
This commit is contained in:
commit
259ef17a55
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