Fix/language support (#2154)
This commit is contained in:
@@ -6,6 +6,7 @@ import cn from 'classnames'
|
||||
import AppIcon from '../../base/app-icon'
|
||||
import type { Collection } from '@/app/components/tools/types'
|
||||
import I18n from '@/context/i18n'
|
||||
import { getModelRuntimeSupported } from '@/utils/language'
|
||||
|
||||
type Props = {
|
||||
isCurrent: boolean
|
||||
@@ -19,7 +20,7 @@ const Item: FC<Props> = ({
|
||||
onClick,
|
||||
}) => {
|
||||
const { locale } = useContext(I18n)
|
||||
|
||||
const language = getModelRuntimeSupported(locale)
|
||||
return (
|
||||
<div
|
||||
className={cn(isCurrent && 'bg-white shadow-xs rounded-lg', 'mt-1 flex h-9 items-center px-2 space-x-2 cursor-pointer')}
|
||||
@@ -41,7 +42,7 @@ const Item: FC<Props> = ({
|
||||
background={payload.icon.background}
|
||||
/>
|
||||
)}
|
||||
<div className={cn(isCurrent && 'text-primary-600 font-semibold', 'leading-5 text-sm font-normal truncate')}>{payload.label[locale === 'en' ? 'en_US' : 'zh_Hans']}</div>
|
||||
<div className={cn(isCurrent && 'text-primary-600 font-semibold', 'leading-5 text-sm font-normal truncate')}>{payload.label[language]}</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
|
Reference in New Issue
Block a user