chore: Enable Japanese descriptions for Tools (#8646)

This commit is contained in:
Shota Totsuka 2024-09-23 10:06:01 +09:00 committed by GitHub
commit 03fdf5e7f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View file

@ -31,10 +31,8 @@ export const languages = data.languages
export const LanguagesSupported = languages.filter(item => item.supported).map(item => item.value)
export const getLanguage = (locale: string) => {
if (locale === 'zh-Hans')
return locale.replace('-', '_')
return LanguagesSupported[0].replace('-', '_')
const supportedLocale = LanguagesSupported.find(lang => lang.startsWith(locale.split('-')[0]))
return (supportedLocale || LanguagesSupported[0]).replace('-', '_')
}
export const NOTICE_I18N = {