1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-15 01:00:12 +01:00

[fix] brave fetch_traits: Brave added Chinese (zh-hant) to UI

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2024-07-29 10:07:42 +02:00
parent 3196e7e86b
commit aa05685cc1

View File

@ -430,10 +430,10 @@ def fetch_traits(engine_traits: EngineTraits):
ui_lang = option.get('value') ui_lang = option.get('value')
try: try:
if '-' in ui_lang: if '-' in ui_lang and not ui_lang.startswith("zh-"):
sxng_tag = region_tag(babel.Locale.parse(ui_lang, sep='-')) sxng_tag = region_tag(babel.Locale.parse(ui_lang, sep='-'))
else: else:
sxng_tag = language_tag(babel.Locale.parse(ui_lang)) sxng_tag = language_tag(babel.Locale.parse(ui_lang, sep='-'))
except babel.UnknownLocaleError: except babel.UnknownLocaleError:
print("ERROR: can't determine babel locale of Brave's (UI) language %s" % ui_lang) print("ERROR: can't determine babel locale of Brave's (UI) language %s" % ui_lang)