From 7ab66bdb482adc6f8a2016b07fe0c5565afca8a9 Mon Sep 17 00:00:00 2001 From: WTW0313 Date: Mon, 21 Jul 2025 21:23:38 +0800 Subject: [PATCH] feat: update deprecation notice to use mixed translation and refactor URL handling --- .../plugins/base/deprecation-notice.tsx | 13 +++++++---- .../plugin-detail-panel/detail-header.tsx | 23 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/web/app/components/plugins/base/deprecation-notice.tsx b/web/app/components/plugins/base/deprecation-notice.tsx index a670bee7cb..d567c3f976 100644 --- a/web/app/components/plugins/base/deprecation-notice.tsx +++ b/web/app/components/plugins/base/deprecation-notice.tsx @@ -3,14 +3,16 @@ import type { FC } from 'react' import Link from 'next/link' import cn from '@/utils/classnames' import { RiAlertFill } from '@remixicon/react' -import { Trans, useTranslation } from 'react-i18next' +import { Trans } from 'react-i18next' import { snakeCase2CamelCase } from '@/utils/format' +import { useMixedTranslation } from '../marketplace/hooks' type DeprecationNoticeProps = { status: 'deleted' | 'active' deprecatedReason: string alternativePluginId: string - urlPrefix: string + alternativePluginURL: string + locale?: string className?: string innerWrapperClassName?: string iconWrapperClassName?: string @@ -23,13 +25,14 @@ const DeprecationNotice: FC = ({ status, deprecatedReason, alternativePluginId, - urlPrefix, + alternativePluginURL, + locale, className, innerWrapperClassName, iconWrapperClassName, textClassName, }) => { - const { t } = useTranslation() + const { t } = useMixedTranslation(locale) const deprecatedReasonKey = useMemo(() => { if (!deprecatedReason) return '' @@ -57,7 +60,7 @@ const DeprecationNotice: FC = ({ components={{ CustomLink: ( - + {isFromMarketplace && ( + + )} { category === PluginType.tool && (