summaryrefslogtreecommitdiff
path: root/searx/locales.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-08-14 15:45:07 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-08-14 15:45:07 +0200
commitde1e7d12f706a4845b8941f7797ef886024a75cb (patch)
treeb29872aa8be68a918f34c9f1807b45b2bfb3695e /searx/locales.py
parentac7776663b801414f7a4e96c49eeab3ca92c659d (diff)
downloadsearxng-de1e7d12f706a4845b8941f7797ef886024a75cb.tar.gz
searxng-de1e7d12f706a4845b8941f7797ef886024a75cb.zip
[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 <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/locales.py')
-rw-r--r--searx/locales.py4
1 files changed, 4 insertions, 0 deletions
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)