[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')
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)