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