fix(web): map pt-BR to pt_BR for tool metadata (#41745)

This commit is contained in:
非法操作 2026-09-03 12:54:46 +00:00 committed by GitHub
parent 4beffa97e0
commit 24f9f07752
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,8 @@ export const LanguagesSupported: Locale[] = languages
.map((item) => item.value)
export const getLanguage = (locale: Locale): Locale => {
if (['zh-Hans', 'ja-JP'].includes(locale)) return locale.replace('-', '_') as Locale
// Plugin metadata supports only en_US, zh_Hans, ja_JP, and pt_BR; otherwise use en_US.
if (['zh-Hans', 'ja-JP', 'pt-BR'].includes(locale)) return locale.replace('-', '_') as Locale
return LanguagesSupported[0]!.replace('-', '_') as Locale
}