From 57749561757cd6df1ff2e87b25f275390a02da23 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 10 Jan 2023 14:53:27 +0800 Subject: [PATCH] chore: update i18n keys --- .../components/workspace-setting/SyncPage.tsx | 23 +++++++++++-------- .../workspace-setting/WorkspaceSetting.tsx | 16 +++++++------ packages/app/src/libs/i18n/resources/en.json | 9 +++++++- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/packages/app/src/components/workspace-setting/SyncPage.tsx b/packages/app/src/components/workspace-setting/SyncPage.tsx index 00bbeb978..0cb0069d2 100644 --- a/packages/app/src/components/workspace-setting/SyncPage.tsx +++ b/packages/app/src/components/workspace-setting/SyncPage.tsx @@ -20,9 +20,7 @@ export const SyncPage = ({ workspace }: { workspace: Workspace }) => { {currentWorkspace?.type === 'local' ? ( <> - {currentWorkspace.name} is Local Workspace. All data is stored on - the current device. You can enable AFFiNE Cloud for this workspace - to keep data in sync with the cloud. + {t('Sync Description', { workspaceName: currentWorkspace.name })} @@ -35,15 +33,20 @@ export const SyncPage = ({ workspace }: { workspace: Workspace }) => { type="primary" shape="circle" > - Enable AFFiNE Cloud + {t('Enable AFFiNE Cloud')} ) : ( <> - {currentWorkspace && currentWorkspace.name} is Cloud - Workspace. All data will be synchronized and saved to the AFFiNE + + + {{ workspaceName: currentWorkspace && currentWorkspace.name }} + + is Cloud Workspace. All data will be synchronized and saved to + the AFFiNE + { }} icon={} > - Download core data to device + {t('Download data to device', { CoreOrAll: 'core' })} { @@ -63,14 +66,16 @@ export const SyncPage = ({ workspace }: { workspace: Workspace }) => { }} icon={} > - Download all data to device + {t('Download data to device', { CoreOrAll: 'all' })} } placement="bottom-end" disablePortal={true} > - + diff --git a/packages/app/src/components/workspace-setting/WorkspaceSetting.tsx b/packages/app/src/components/workspace-setting/WorkspaceSetting.tsx index c0213c2cc..64ffd5b8f 100644 --- a/packages/app/src/components/workspace-setting/WorkspaceSetting.tsx +++ b/packages/app/src/components/workspace-setting/WorkspaceSetting.tsx @@ -21,6 +21,7 @@ import { PublishPage } from './PublishPage'; import { ExportPage } from './ExportPage'; import { SyncPage } from './SyncPage'; import { useAppState } from '@/providers/app-state-provider'; +import { useTranslation } from 'react-i18next'; enum ActiveTab { 'general' = 'general', @@ -41,6 +42,7 @@ type WorkspaceSettingProps = { }; const WorkspaceSettingTab = ({ activeTab, onTabChange }: SettingTabProps) => { + const { t } = useTranslation(); return ( { - General + {t('General')} { - Sync + {t('Sync')} { - Collaboration + {t('Collaboration')} { - Publish + {t('Publish')} { - Export + {t('Export')} ); @@ -114,7 +116,7 @@ export const WorkspaceSetting = ({ const handleTabChange = (tab: ActiveTab) => { setActiveTab(tab); }; - + const { t } = useTranslation(); const { currentMetaWorkSpace } = useAppState(); const handleClickClose = () => { onClose && onClose(); @@ -133,7 +135,7 @@ export const WorkspaceSetting = ({ {isOwner ? ( - Workspace Settings + {t('Workspace Settings')} {{workspaceName}} is Cloud Workspace. All data will be synchronized and saved to the AFFiNE", + "Download data to device": "Download {{CoreOrAll}} data to device", + "General": "General", + "Sync": "Sync", + "Collaboration": "Collaboration", + "Publish": "Publish", + "Workspace Settings": "Workspace Settings" }