mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 08:26:27 +08:00
fix: marketplace card i18n (#12623)
This commit is contained in:
parent
c08b451874
commit
d56079a549
@ -13,6 +13,7 @@ import { useGetLanguage } from '@/context/i18n'
|
|||||||
import { getLanguage } from '@/i18n/language'
|
import { getLanguage } from '@/i18n/language'
|
||||||
import { useSingleCategories } from '../hooks'
|
import { useSingleCategories } from '../hooks'
|
||||||
import { renderI18nObject } from '@/hooks/use-i18n'
|
import { renderI18nObject } from '@/hooks/use-i18n'
|
||||||
|
import { useMixedTranslation } from '@/app/components/plugins/marketplace/hooks'
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
className?: string
|
className?: string
|
||||||
@ -43,7 +44,8 @@ const Card = ({
|
|||||||
}: Props) => {
|
}: Props) => {
|
||||||
const defaultLocale = useGetLanguage()
|
const defaultLocale = useGetLanguage()
|
||||||
const locale = localeFromProps ? getLanguage(localeFromProps) : defaultLocale
|
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 { category, type, name, org, label, brief, icon, verified } = payload
|
||||||
const isBundle = !['plugin', 'model', 'tool', 'extension', 'agent-strategy'].includes(type)
|
const isBundle = !['plugin', 'model', 'tool', 'extension', 'agent-strategy'].includes(type)
|
||||||
const cornerMark = isBundle ? categoriesMap.bundle?.label : categoriesMap[category]?.label
|
const cornerMark = isBundle ? categoriesMap.bundle?.label : categoriesMap[category]?.label
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user