mirror of
https://github.com/searxng/searxng.git
synced 2024-11-17 09:50:13 +01:00
[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>
This commit is contained in:
parent
ac7776663b
commit
de1e7d12f7
@ -252,8 +252,12 @@ def get_engine_locale(searxng_locale, engine_locales, default=None):
|
|||||||
terr_lang_dict[territory] = langs.get(searxng_lang)
|
terr_lang_dict[territory] = langs.get(searxng_lang)
|
||||||
|
|
||||||
# first: check fr-FR, de-DE .. is supported by the engine
|
# first: check fr-FR, de-DE .. is supported by the engine
|
||||||
|
# exception: 'en' --> 'en-US'
|
||||||
|
|
||||||
territory = locale.language.upper()
|
territory = locale.language.upper()
|
||||||
|
if territory == 'EN':
|
||||||
|
territory = 'US'
|
||||||
|
|
||||||
if terr_lang_dict.get(territory):
|
if terr_lang_dict.get(territory):
|
||||||
searxng_locale = locale.language + '-' + territory
|
searxng_locale = locale.language + '-' + territory
|
||||||
engine_locale = engine_locales.get(searxng_locale)
|
engine_locale = engine_locales.get(searxng_locale)
|
||||||
|
Loading…
Reference in New Issue
Block a user