mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-09 01:23:10 +03:00
Set the displayed language with a URL query parameter (#1566)
This commit is contained in:
parent
b4a8711a8f
commit
e89686c6b3
1 changed files with 5 additions and 3 deletions
|
@ -125,9 +125,11 @@ $config['language_codes'] = $languages;
|
|||
|
||||
$language_code = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : 'en';
|
||||
|
||||
$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages[$language_code])
|
||||
? $languages[$language_code]
|
||||
: Config::LANGUAGE;
|
||||
$config['language'] =
|
||||
$_GET['language'] ??
|
||||
(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages[$language_code])
|
||||
? $languages[$language_code]
|
||||
: Config::LANGUAGE);
|
||||
|
||||
$config['language_code'] = array_search($config['language'], $languages) ?: 'en';
|
||||
|
||||
|
|
Loading…
Reference in a new issue