From c469da20205a7245ab39eadfa5301d1239f0d56c Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 2 Jan 2025 14:22:04 +0800 Subject: [PATCH] fix: handle install title and descript may caused i18n problem --- web/app/components/plugins/card/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx index 235f4d4953..ff86a3c39c 100644 --- a/web/app/components/plugins/card/index.tsx +++ b/web/app/components/plugins/card/index.tsx @@ -12,6 +12,7 @@ import cn from '@/utils/classnames' import { useGetLanguage } from '@/context/i18n' import { getLanguage } from '@/i18n/language' import { useCategories } from '../hooks' +import { renderI18nObject } from '@/hooks/use-i18n' export type Props = { className?: string @@ -47,7 +48,7 @@ const Card = ({ const isBundle = !['plugin', 'model', 'tool', 'extension', 'agent_strategy'].includes(type) const cornerMark = isBundle ? categoriesMap.bundle?.label : categoriesMap[category]?.label const getLocalizedText = (obj: Record | undefined) => - obj?.[locale] || obj?.['en-US'] || obj?.en_US || '' + obj ? renderI18nObject(obj, locale) : '' const wrapClassName = cn('relative p-4 pb-3 border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg hover-bg-components-panel-on-panel-item-bg rounded-xl shadow-xs', className) if (isLoading) {