diff --git a/web/app/components/plugins/marketplace/description/index.tsx b/web/app/components/plugins/marketplace/description/index.tsx index 9e3f9774b5..d1be3c9806 100644 --- a/web/app/components/plugins/marketplace/description/index.tsx +++ b/web/app/components/plugins/marketplace/description/index.tsx @@ -19,20 +19,20 @@ const Description = async ({

{t('marketplace.discover')} - - {t('category.models')} + + {t('category.models')} , - - {t('category.tools')} + + {t('category.tools')} , - - {t('category.extensions')} + + {t('category.extensions')} {t('marketplace.and')} - - {t('category.bundles')} + + {t('category.bundles')} {t('marketplace.inDifyMarketplace')}

diff --git a/web/app/components/plugins/marketplace/empty/index.tsx b/web/app/components/plugins/marketplace/empty/index.tsx index cc3957d3ff..25f8efc504 100644 --- a/web/app/components/plugins/marketplace/empty/index.tsx +++ b/web/app/components/plugins/marketplace/empty/index.tsx @@ -1,25 +1,31 @@ +'use client' +import { useTranslation } from 'react-i18next' import { Group } from '@/app/components/base/icons/src/vender/other' import Line from './line' +import cn from '@/utils/classnames' const Empty = () => { + const { t } = useTranslation() + return (
{ Array.from({ length: 16 }).map((_, index) => (
11 && 'mb-0', + )} >
)) }
@@ -30,7 +36,7 @@ const Empty = () => {
- No plugin found + {t('plugin.marketplace.noPluginFound')}
diff --git a/web/app/components/plugins/marketplace/list/list-wrapper.tsx b/web/app/components/plugins/marketplace/list/list-wrapper.tsx index 936cb7ec57..cf31bf9dee 100644 --- a/web/app/components/plugins/marketplace/list/list-wrapper.tsx +++ b/web/app/components/plugins/marketplace/list/list-wrapper.tsx @@ -1,4 +1,5 @@ 'use client' +import { useTranslation } from 'react-i18next' import type { Plugin } from '../../types' import type { MarketplaceCollection } from '../types' import { useMarketplaceContext } from '../context' @@ -18,6 +19,7 @@ const ListWrapper = ({ showInstallButton, locale, }: ListWrapperProps) => { + const { t } = useTranslation() const plugins = useMarketplaceContext(v => v.plugins) const marketplaceCollectionsFromClient = useMarketplaceContext(v => v.marketplaceCollectionsFromClient) const marketplaceCollectionPluginsMapFromClient = useMarketplaceContext(v => v.marketplaceCollectionPluginsMapFromClient) @@ -28,7 +30,7 @@ const ListWrapper = ({ { plugins && (
-
{plugins.length} results
+
{t('plugin.marketplace.pluginsResult', { num: plugins.length })}
diff --git a/web/app/components/plugins/marketplace/sort-dropdown/index.tsx b/web/app/components/plugins/marketplace/sort-dropdown/index.tsx index ed1d788b29..df520f26c1 100644 --- a/web/app/components/plugins/marketplace/sort-dropdown/index.tsx +++ b/web/app/components/plugins/marketplace/sort-dropdown/index.tsx @@ -4,6 +4,7 @@ import { RiArrowDownSLine, RiCheckLine, } from '@remixicon/react' +import { useTranslation } from 'react-i18next' import { useMarketplaceContext } from '../context' import { PortalToFollowElem, @@ -11,30 +12,30 @@ import { PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' -const options = [ - { - value: 'install_count', - order: 'DESC', - text: 'Most Popular', - }, - { - value: 'version_updated_at', - order: 'DESC', - text: 'Recently Updated', - }, - { - value: 'created_at', - order: 'DESC', - text: 'Newly Released', - }, - { - value: 'created_at', - order: 'ASC', - text: 'First Released', - }, -] - const SortDropdown = () => { + const { t } = useTranslation() + const options = [ + { + value: 'install_count', + order: 'DESC', + text: t('plugin.marketplace.sortOption.mostPopular'), + }, + { + value: 'version_updated_at', + order: 'DESC', + text: t('plugin.marketplace.sortOption.recentlyUpdated'), + }, + { + value: 'created_at', + order: 'DESC', + text: t('plugin.marketplace.sortOption.newlyReleased'), + }, + { + value: 'created_at', + order: 'ASC', + text: t('plugin.marketplace.sortOption.firstReleased'), + }, + ] const sort = useMarketplaceContext(v => v.sort) const handleSortChange = useMarketplaceContext(v => v.handleSortChange) const [open, setOpen] = useState(false) @@ -53,7 +54,7 @@ const SortDropdown = () => { setOpen(v => !v)}>
- Sort by + {t('plugin.marketplace.sortBy')} {selectedOption.text} diff --git a/web/app/components/tools/marketplace/index.tsx b/web/app/components/tools/marketplace/index.tsx index c50b898362..e7c1aaec9e 100644 --- a/web/app/components/tools/marketplace/index.tsx +++ b/web/app/components/tools/marketplace/index.tsx @@ -25,7 +25,7 @@ const Marketplace = ({ } = useMarketplace(searchPluginText, filterPluginTags) return ( -
+
onMarketplaceScroll()} diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index 91f17e07f3..402d1a21b1 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -128,6 +128,15 @@ const translation = { and: 'and', inDifyMarketplace: 'in Dify Marketplace', moreFrom: 'More from Marketplace', + noPluginFound: 'No plugin found', + pluginsResult: '{{num}} results', + sortBy: 'Sort by', + sortOption: { + mostPopular: 'Most Popular', + recentlyUpdated: 'Recently Updated', + newlyReleased: 'Newly Released', + firstReleased: 'First Released', + }, }, task: { installing: 'Installing {{installingLength}}/{{totalLength}} plugins...', diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index 30de7acced..a78fdb31f7 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -128,6 +128,15 @@ const translation = { and: '和', inDifyMarketplace: '在 Dify 市场中', moreFrom: '更多来自市场', + noPluginFound: '未找到插件', + pluginsResult: '{{num}} 个插件结果', + sortBy: '排序方式', + sortOption: { + mostPopular: '最受欢迎', + recentlyUpdated: '最近更新', + newlyReleased: '最新发布', + firstReleased: '首次发布', + }, }, task: { installing: '{{installingLength}}/{{totalLength}} 插件安装中...', diff --git a/web/tailwind-common-config.ts b/web/tailwind-common-config.ts index c1ec16a6a1..41f36bc17a 100644 --- a/web/tailwind-common-config.ts +++ b/web/tailwind-common-config.ts @@ -88,6 +88,7 @@ const config = { 'chat-bubble-bg': 'var(--color-chat-bubble-bg)', 'workflow-process-bg': 'var(--color-workflow-process-bg)', 'marketplace-divider-bg': 'var(--color-marketplace-divider-bg)', + 'marketplace-plugin-empty': 'var(--color-marketplace-plugin-empty)', }, animation: { 'spin-slow': 'spin 2s linear infinite', diff --git a/web/themes/dark.css b/web/themes/dark.css index 08994039eb..a4ef4e001b 100644 --- a/web/themes/dark.css +++ b/web/themes/dark.css @@ -695,4 +695,5 @@ html[data-theme="dark"] { --color-third-party-model-bg-default: #0B0B0E; --color-workflow-process-bg: linear-gradient(90deg, rgba(24, 24, 27, 0.25) 0%, rgba(24, 24, 27, 0.04) 100%); --color-marketplace-divider-bg: linear-gradient(90deg, rgba(200, 206, 218, 0.14) 0%, rgba(0, 0, 0, 0) 100%); + --color-marketplace-plugin-empty: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #222225 100%); } \ No newline at end of file diff --git a/web/themes/light.css b/web/themes/light.css index ed563ad594..4f380e50e4 100644 --- a/web/themes/light.css +++ b/web/themes/light.css @@ -695,4 +695,5 @@ html[data-theme="light"] { --color-third-party-model-bg-default: #F9FAFB; --color-workflow-process-bg: linear-gradient(90deg, rgba(200, 206, 218, 0.20) 0%, rgba(200, 206, 218, 0.04) 100%); --color-marketplace-divider-bg: linear-gradient(90deg, rgba(16, 24, 40, 0.08) 0%, rgba(255, 255, 255, 0) 100%); + --color-marketplace-plugin-empty: linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FCFCFD 100%); } \ No newline at end of file