Set the displayed language with a URL query parameter (#1566)

This commit is contained in:
Alex Tselegidis 2024-07-22 10:15:28 +02:00
parent b4a8711a8f
commit e89686c6b3

View file

@ -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';