mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 17:33:19 +03:00
Missing language mappings would cause issues with the auto-detection of the user's language.
This commit is contained in:
parent
99a5423e41
commit
b6a17d4e11
1 changed files with 34 additions and 26 deletions
|
@ -82,11 +82,12 @@ $config['url_suffix'] = '';
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?
|
$languages = [
|
||||||
[
|
|
||||||
'ar' => 'arabic',
|
'ar' => 'arabic',
|
||||||
'bu' => 'bulgarian',
|
'bu' => 'bulgarian',
|
||||||
|
'ca' => 'catalan',
|
||||||
'zh' => 'chinese',
|
'zh' => 'chinese',
|
||||||
|
'cs' => 'czech',
|
||||||
'da' => 'danish',
|
'da' => 'danish',
|
||||||
'nl' => 'dutch',
|
'nl' => 'dutch',
|
||||||
'en' => 'english',
|
'en' => 'english',
|
||||||
|
@ -99,15 +100,22 @@ $config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?
|
||||||
'hu' => 'hungarian',
|
'hu' => 'hungarian',
|
||||||
'it' => 'italian',
|
'it' => 'italian',
|
||||||
'ja' => 'japanese',
|
'ja' => 'japanese',
|
||||||
|
'lb' => 'luxembourgish',
|
||||||
|
'mr' => 'marathi',
|
||||||
'pl' => 'polish',
|
'pl' => 'polish',
|
||||||
'pt' => 'portuguese',
|
'pt' => 'portuguese',
|
||||||
'ro' => 'romanian',
|
'ro' => 'romanian',
|
||||||
'ru' => 'russian',
|
'ru' => 'russian',
|
||||||
'sk' => 'slovak',
|
'sk' => 'slovak',
|
||||||
'es' => 'spanish',
|
'es' => 'spanish',
|
||||||
|
'sv' => 'swedish',
|
||||||
'tr' => 'turkish',
|
'tr' => 'turkish',
|
||||||
'sv' => 'swedish'
|
];
|
||||||
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
|
||||||
|
$language_code = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||||
|
|
||||||
|
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages[$language_code])
|
||||||
|
? $languages[$language_code]
|
||||||
: Config::LANGUAGE;
|
: Config::LANGUAGE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue