Merge pull request #476 from HB9HIL/fix_browser_lang

fallback to default language if browsers language wasn't found
This commit is contained in:
HB9HIL
2024-06-18 17:20:48 +02:00
committed by GitHub

View File

@@ -257,7 +257,7 @@ class Gettext
{
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$code = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$lang = $this->find_by('code', $code);
$lang = $this->find_by('code', $code) ?: $this->default;
} else {
$code = 'en';
$lang = $this->find_by('code', $code);