fix: marketplace card i18n (#12623)

This commit is contained in:
zxhlyh 2025-01-10 18:15:58 +08:00 committed by GitHub
parent c08b451874
commit d56079a549
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import { useGetLanguage } from '@/context/i18n'
import { getLanguage } from '@/i18n/language'
import { useSingleCategories } from '../hooks'
import { renderI18nObject } from '@/hooks/use-i18n'
import { useMixedTranslation } from '@/app/components/plugins/marketplace/hooks'
export type Props = {
className?: string
@ -43,7 +44,8 @@ const Card = ({
}: Props) => {
const defaultLocale = useGetLanguage()
const locale = localeFromProps ? getLanguage(localeFromProps) : defaultLocale
const { categoriesMap } = useSingleCategories()
const { t } = useMixedTranslation(localeFromProps)
const { categoriesMap } = useSingleCategories(t)
const { category, type, name, org, label, brief, icon, verified } = payload
const isBundle = !['plugin', 'model', 'tool', 'extension', 'agent-strategy'].includes(type)
const cornerMark = isBundle ? categoriesMap.bundle?.label : categoriesMap[category]?.label