From e47e491ea454989c2d8a3ec87f965adc8bf12465 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 18 Jun 2024 08:24:08 +0200 Subject: [PATCH] fallback to default language if browsers language wasn't found --- application/hooks/gettext/Gettext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/hooks/gettext/Gettext.php b/application/hooks/gettext/Gettext.php index 264f9b2d6..84325d404 100644 --- a/application/hooks/gettext/Gettext.php +++ b/application/hooks/gettext/Gettext.php @@ -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);