From aa05685cc15e427cf05266360ffccdd8ba489a3c Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 29 Jul 2024 10:07:42 +0200 Subject: [PATCH] [fix] brave fetch_traits: Brave added Chinese (zh-hant) to UI Signed-off-by: Markus Heiser --- searx/engines/brave.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/engines/brave.py b/searx/engines/brave.py index fea7fb69d..4c43386ed 100644 --- a/searx/engines/brave.py +++ b/searx/engines/brave.py @@ -430,10 +430,10 @@ def fetch_traits(engine_traits: EngineTraits): ui_lang = option.get('value') 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='-')) else: - sxng_tag = language_tag(babel.Locale.parse(ui_lang)) + sxng_tag = language_tag(babel.Locale.parse(ui_lang, sep='-')) except babel.UnknownLocaleError: print("ERROR: can't determine babel locale of Brave's (UI) language %s" % ui_lang)