Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore: update i18n keys

JimmFly57749561757c
diff --git a/packages/app/src/components/workspace-setting/SyncPage.tsx b/packages/app/src/components/workspace-setting/SyncPage.tsx
index 00bbeb9785..0cb0069d2d 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' ? (
<>
<StyledPublishExplanation>
- {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 })}
</StyledPublishExplanation>
<StyledPublishCopyContainer>
@@ -35,15 +33,20 @@ export const SyncPage = ({ workspace }: { workspace: Workspace }) => {
type="primary"
shape="circle"
>
- Enable AFFiNE Cloud
+ {t('Enable AFFiNE Cloud')}
</Button>
</StyledPublishCopyContainer>
</>
) : (
<>
<StyledPublishExplanation>
- <code>{currentWorkspace && currentWorkspace.name}</code> is Cloud
- Workspace. All data will be synchronized and saved to the AFFiNE
+ <Trans i18nKey="Sync Description2">
+ <code>
+ {{ workspaceName: currentWorkspace && currentWorkspace.name }}
+ </code>
+ is Cloud Workspace. All data will be synchronized and saved to
+ the AFFiNE
+ </Trans>
</StyledPublishExplanation>
<StyledPublishCopyContainer>
<Menu
@@ -55,7 +58,7 @@ export const SyncPage = ({ workspace }: { workspace: Workspace }) => {
}}
icon={<DownloadIcon />}
>
- Download core data to device
+ {t('Download data to device', { CoreOrAll: 'core' })}
</MenuItem>
<MenuItem
onClick={() => {
@@ -63,14 +66,16 @@ export const SyncPage = ({ workspace }: { workspace: Workspace }) => {
}}
icon={<DownloadIcon />}
>
- Download all data to device
+ {t('Download data to device', { CoreOrAll: 'all' })}
</MenuItem>
</>
}
placement="bottom-end"
disablePortal={true}
>
- <Button>Download all data to device</Button>
+ <Button>
+ {t('Download data to device', { CoreOrAll: 'all' })}
+ </Button>
</Menu>
</StyledPublishCopyContainer>
</>
diff --git a/packages/app/src/components/workspace-setting/WorkspaceSetting.tsx b/packages/app/src/components/workspace-setting/WorkspaceSetting.tsx
index c0213c2cca..64ffd5b8f9 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 (
<StyledSettingTabContainer>
<WorkspaceSettingTagItem
@@ -52,7 +54,7 @@ const WorkspaceSettingTab = ({ activeTab, onTabChange }: SettingTabProps) => {
<StyledSettingTagIconContainer>
<EditIcon />
</StyledSettingTagIconContainer>
- General
+ {t('General')}
</WorkspaceSettingTagItem>
<WorkspaceSettingTagItem
@@ -64,7 +66,7 @@ const WorkspaceSettingTab = ({ activeTab, onTabChange }: SettingTabProps) => {
<StyledSettingTagIconContainer>
<CloudInsyncIcon />
</StyledSettingTagIconContainer>
- Sync
+ {t('Sync')}
</WorkspaceSettingTagItem>
<WorkspaceSettingTagItem
@@ -76,7 +78,7 @@ const WorkspaceSettingTab = ({ activeTab, onTabChange }: SettingTabProps) => {
<StyledSettingTagIconContainer>
<UsersIcon />
</StyledSettingTagIconContainer>
- Collaboration
+ {t('Collaboration')}
</WorkspaceSettingTagItem>
<WorkspaceSettingTagItem
isActive={activeTab === ActiveTab.publish}
@@ -87,7 +89,7 @@ const WorkspaceSettingTab = ({ activeTab, onTabChange }: SettingTabProps) => {
<StyledSettingTagIconContainer>
<PublishIcon />
</StyledSettingTagIconContainer>
- Publish
+ {t('Publish')}
</WorkspaceSettingTagItem>
<WorkspaceSettingTagItem
@@ -99,7 +101,7 @@ const WorkspaceSettingTab = ({ activeTab, onTabChange }: SettingTabProps) => {
<StyledSettingTagIconContainer>
<PublishIcon />
</StyledSettingTagIconContainer>
- Export
+ {t('Export')}
</WorkspaceSettingTagItem>
</StyledSettingTabContainer>
);
@@ -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 ? (
<StyledSettingSidebar>
<StyledSettingSidebarHeader>
- Workspace Settings
+ {t('Workspace Settings')}
</StyledSettingSidebarHeader>
<WorkspaceSettingTab
activeTab={activeTab}
diff --git a/packages/app/src/libs/i18n/resources/en.json b/packages/app/src/libs/i18n/resources/en.json
index abda9964ab..49a6bf3ab1 100644
--- a/packages/app/src/libs/i18n/resources/en.json
+++ b/packages/app/src/libs/i18n/resources/en.json
@@ -132,5 +132,12 @@
"Publishing Description": "After publishing to the web, everyone can view the content of this workspace through the link.",
"Stop publishing": "Stop publishing",
"Publish to web": "Publish to web",
- "Sync Description": "{{workspaceName}} 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."
+ "Sync Description": "{{workspaceName}} 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.",
+ "Sync Description2": "<1>{{workspaceName}}</1> 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"
}