diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-07-29 10:07:42 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-07-29 10:28:53 +0200 |
commit | edfd0e2fe51c4d177171d21a2f62807c32f2dc27 (patch) | |
tree | b1812d50512554a85a176569d6908c2665d0fce4 | |
parent | 3196e7e86b5a9ea0ab6f7453e12834eb245009e7 (diff) | |
download | searxng-edfd0e2fe51c4d177171d21a2f62807c32f2dc27.tar.gz searxng-edfd0e2fe51c4d177171d21a2f62807c32f2dc27.zip |
[fix] brave fetch_traits: Brave added Chinese (zh-hant) to UI
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r-- | searx/engines/brave.py | 4 |
1 files 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) |