From 9815a0911bca9519469a5f215392487503febbd4 Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:53:11 +0800 Subject: [PATCH] fix: tools description is missing (#8999) --- web/i18n/language.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/i18n/language.ts b/web/i18n/language.ts index c2e23cc19a..fde69328bd 100644 --- a/web/i18n/language.ts +++ b/web/i18n/language.ts @@ -31,8 +31,10 @@ export const languages = data.languages export const LanguagesSupported = languages.filter(item => item.supported).map(item => item.value) export const getLanguage = (locale: string) => { - const supportedLocale = LanguagesSupported.find(lang => lang.startsWith(locale.split('-')[0])) - return (supportedLocale || LanguagesSupported[0]).replace('-', '_') + if (locale === 'zh-Hans') + return locale.replace('-', '_') + + return LanguagesSupported[0].replace('-', '_') } export const NOTICE_I18N = {