From de1e7d12f706a4845b8941f7797ef886024a75cb Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 14 Aug 2022 15:45:07 +0200 Subject: [PATCH] [fix] get_engine_locale: better approximation of 'en' is 'en-US' Compared to `en-EN` the better approximation of 'en' is 'en-US'. Signed-off-by: Markus Heiser --- searx/locales.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/searx/locales.py b/searx/locales.py index b7c0badd9..0e57c91b0 100644 --- a/searx/locales.py +++ b/searx/locales.py @@ -252,8 +252,12 @@ def get_engine_locale(searxng_locale, engine_locales, default=None): terr_lang_dict[territory] = langs.get(searxng_lang) # first: check fr-FR, de-DE .. is supported by the engine + # exception: 'en' --> 'en-US' territory = locale.language.upper() + if territory == 'EN': + territory = 'US' + if terr_lang_dict.get(territory): searxng_locale = locale.language + '-' + territory engine_locale = engine_locales.get(searxng_locale)