mirror of https://github.com/searxng/searxng.git
[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:
parent
3196e7e86b
commit
aa05685cc1
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue