forked from mirrors/easyappointments
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,32 +82,40 @@ $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',
|
||||||
'da' => 'danish',
|
'cs' => 'czech',
|
||||||
'nl' => 'dutch',
|
'da' => 'danish',
|
||||||
'en' => 'english',
|
'nl' => 'dutch',
|
||||||
'fi' => 'finnish',
|
'en' => 'english',
|
||||||
'fr' => 'french',
|
'fi' => 'finnish',
|
||||||
'de' => 'german',
|
'fr' => 'french',
|
||||||
'el' => 'greek',
|
'de' => 'german',
|
||||||
'he' => 'hebrew',
|
'el' => 'greek',
|
||||||
'hi' => 'hindi',
|
'he' => 'hebrew',
|
||||||
'hu' => 'hungarian',
|
'hi' => 'hindi',
|
||||||
'it' => 'italian',
|
'hu' => 'hungarian',
|
||||||
'ja' => 'japanese',
|
'it' => 'italian',
|
||||||
'pl' => 'polish',
|
'ja' => 'japanese',
|
||||||
'pt' => 'portuguese',
|
'lb' => 'luxembourgish',
|
||||||
'ro' => 'romanian',
|
'mr' => 'marathi',
|
||||||
'ru' => 'russian',
|
'pl' => 'polish',
|
||||||
'sk' => 'slovak',
|
'pt' => 'portuguese',
|
||||||
'es' => 'spanish',
|
'ro' => 'romanian',
|
||||||
'tr' => 'turkish',
|
'ru' => 'russian',
|
||||||
'sv' => 'swedish'
|
'sk' => 'slovak',
|
||||||
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
|
'es' => 'spanish',
|
||||||
|
'sv' => 'swedish',
|
||||||
|
'tr' => 'turkish',
|
||||||
|
];
|
||||||
|
|
||||||
|
$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