mirror of
https://github.com/searxng/searxng.git
synced 2024-12-23 09:46:31 +00: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
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue