65 from searx
import network
66 from babel
import Locale, languages
69 territories = Locale(
"en").territories
71 json = network.get(base_url +
"/docs/openapi.json").json()
72 regions = json[
'components'][
'schemas'][
'Region'][
'enum']
74 engine_traits.all_locale = regions[0]
76 for region
in regions[1:]:
77 for code, name
in territories.items():
78 if region
not in (code, name):
80 for lang
in languages.get_official_languages(code, de_facto=
True):
81 engine_traits.regions[region_tag(Locale(lang, code))] = region