diff --git a/apps/web/src/components/ChatPane.tsx b/apps/web/src/components/ChatPane.tsx index be9bf94df..11cb23cdf 100644 --- a/apps/web/src/components/ChatPane.tsx +++ b/apps/web/src/components/ChatPane.tsx @@ -1,7 +1,7 @@ import { Fragment, useEffect, useRef, useState, type MutableRefObject, type ReactNode } from 'react'; import { useAnalytics } from '../analytics/provider'; import { trackChatPanelClick } from '../analytics/events'; -import { useI18n } from '../i18n'; +import { useI18n, useT } from '../i18n'; import type { Dict } from '../i18n/types'; import { copyToClipboard } from '../lib/copy-to-clipboard'; import { projectRawUrl } from '../providers/registry'; diff --git a/apps/web/src/components/DesignSystemsTab.tsx b/apps/web/src/components/DesignSystemsTab.tsx index d859705e6..084a635f4 100644 --- a/apps/web/src/components/DesignSystemsTab.tsx +++ b/apps/web/src/components/DesignSystemsTab.tsx @@ -115,6 +115,13 @@ export function DesignSystemsTab({ templates = [], }: Props) { const { locale, t } = useI18n(); + const isZhCN = locale === 'zh-CN'; + const primaryDesignSystemLabel = isZhCN ? t('ds.userSystemsEyebrow') : 'Design system'; + const primaryTemplateLabel = isZhCN ? t('ds.templatesTitle') : 'Template'; + const userSystemsLabel = isZhCN ? t('ds.userSystemsTitle') : 'Your systems'; + const officialPresetsLabel = isZhCN ? t('ds.libraryTitle') : 'Official presets'; + const enterpriseLabel = isZhCN ? '企业' : 'Enterprise'; + const templateMineLabel = isZhCN ? t('ds.templatesTitle') : 'Your templates'; const analytics = useAnalytics(); const designSystemsPageViewFiredRef = useRef(false); useEffect(() => { @@ -165,6 +172,10 @@ export function DesignSystemsTab({ if (userFilter === 'all') return editable; return editable.filter((system) => (system.status ?? 'draft') === userFilter); }, [systems, userFilter]); + const showOfficialLibrary = + primaryCollection === 'design-system' && + (designSystemCollection === 'official' || + (designSystemCollection === 'mine' && userSystems.length === 0 && librarySystems.length > 0)); // Total systems per surface, ignoring every active filter. Drives the // "this surface is now empty" fallback below — that guard must react to @@ -390,7 +401,7 @@ export function DesignSystemsTab({ className={primaryCollection === 'design-system' ? 'active' : ''} onClick={() => setPrimaryCollection('design-system')} > - Design system + {primaryDesignSystemLabel} @@ -414,7 +425,7 @@ export function DesignSystemsTab({ className={designSystemCollection === 'mine' ? 'active' : ''} onClick={() => setDesignSystemCollection('mine')} > - Your systems + {userSystemsLabel} @@ -446,7 +457,7 @@ export function DesignSystemsTab({ className={templateCollection === 'mine' ? 'active' : ''} onClick={() => setTemplateCollection('mine')} > - Your templates + {templateMineLabel}