Fix/language support (#2154)
This commit is contained in:
@@ -8,6 +8,7 @@ import type { Collection } from '../types'
|
||||
import { CollectionType, LOC } from '../types'
|
||||
import { Settings01 } from '../../base/icons/src/vender/line/general'
|
||||
import I18n from '@/context/i18n'
|
||||
import { getModelRuntimeSupported } from '@/utils/language'
|
||||
|
||||
type Props = {
|
||||
icon: JSX.Element
|
||||
@@ -25,6 +26,7 @@ const Header: FC<Props> = ({
|
||||
onShowEditCustomCollection,
|
||||
}) => {
|
||||
const { locale } = useContext(I18n)
|
||||
const language = getModelRuntimeSupported(locale)
|
||||
const { t } = useTranslation()
|
||||
const isInToolsPage = loc === LOC.tools
|
||||
const isInDebugPage = !isInToolsPage
|
||||
@@ -38,13 +40,13 @@ const Header: FC<Props> = ({
|
||||
{icon}
|
||||
<div className='ml-3 grow w-0'>
|
||||
<div className='flex items-center h-6 space-x-1'>
|
||||
<div className={cn(isInDebugPage && 'truncate', 'text-base font-semibold text-gray-900')}>{collection.label[locale === 'en' ? 'en_US' : 'zh_Hans']}</div>
|
||||
<div className={cn(isInDebugPage && 'truncate', 'text-base font-semibold text-gray-900')}>{collection.label[language]}</div>
|
||||
<div className='text-xs font-normal text-gray-500'>·</div>
|
||||
<div className='text-xs font-normal text-gray-500'>{t('tools.author')} {collection.author}</div>
|
||||
</div>
|
||||
{collection.description && (
|
||||
<div className={cn('leading-[18px] text-[13px] font-normal text-gray-500')}>
|
||||
{collection.description[locale === 'en' ? 'en_US' : 'zh_Hans']}
|
||||
{collection.description[language]}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
@@ -10,6 +10,7 @@ import { CollectionType } from '../types'
|
||||
import TooltipPlus from '../../base/tooltip-plus'
|
||||
import I18n from '@/context/i18n'
|
||||
import SettingBuiltInTool from '@/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool'
|
||||
import { getModelRuntimeSupported } from '@/utils/language'
|
||||
|
||||
type Props = {
|
||||
collection: Collection
|
||||
@@ -32,6 +33,7 @@ const Item: FC<Props> = ({
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const { locale } = useContext(I18n)
|
||||
const language = getModelRuntimeSupported(locale)
|
||||
const isBuiltIn = collection.type === CollectionType.builtIn
|
||||
const canShowDetail = !isBuiltIn || (isBuiltIn && isInToolsPage)
|
||||
const [showDetail, setShowDetail] = useState(false)
|
||||
@@ -45,9 +47,9 @@ const Item: FC<Props> = ({
|
||||
<div className='flex items-start w-full'>
|
||||
{icon}
|
||||
<div className='ml-3 w-0 grow'>
|
||||
<div className={cn('text-base font-semibold text-gray-900 truncate')}>{payload.label[locale === 'en' ? 'en_US' : 'zh_Hans']}</div>
|
||||
<div className={cn('text-base font-semibold text-gray-900 truncate')}>{payload.label[language]}</div>
|
||||
<div className={cn('leading-[18px] text-[13px] font-normal text-gray-500')}>
|
||||
{payload.description[locale === 'en' ? 'en_US' : 'zh_Hans']}
|
||||
{payload.description[language]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user