diff --git a/apps/core/src/components/affine/auth/no-access.tsx b/apps/core/src/components/affine/auth/no-access.tsx index 961b6e4b98..2d9cdc64ba 100644 --- a/apps/core/src/components/affine/auth/no-access.tsx +++ b/apps/core/src/components/affine/auth/no-access.tsx @@ -22,7 +22,7 @@ export const NoAccess: FC = ({ setAuthState, onSignedIn }) => { return ( <> diff --git a/apps/core/src/components/affine/auth/send-email.tsx b/apps/core/src/components/affine/auth/send-email.tsx index 228252118b..79e03629fa 100644 --- a/apps/core/src/components/affine/auth/send-email.tsx +++ b/apps/core/src/components/affine/auth/send-email.tsx @@ -147,7 +147,10 @@ export const SendEmail = ({ return ( <> - + {t['com.affine.auth.reset.password.message']()} = ({ <> = ({ <> @@ -150,8 +152,10 @@ const SetDBLocationContent = ({ return (
-
{t['Set database location']()}
-

{t['Workspace database storage description']()}

+
+ {t['com.affine.setDBLocation.title']()} +
+

{t['com.affine.setDBLocation.description']()}

- {t['Default Location']()} + {t['com.affine.setDBLocation.button.defaultLocation']()}
@@ -201,7 +205,9 @@ const SetSyncingModeContent = ({ return (
- {t[mode === 'new' ? 'Created Successfully' : 'Added Successfully']()} + {mode === 'new' + ? t['com.affine.setSyncingMode.title.created']() + : t['com.affine.setSyncingMode.title.added']()}
@@ -212,7 +218,7 @@ const SetSyncingModeContent = ({ readOnly checked={!enableCloudSyncing} /> - {t['Use on current device only']()} + {t['com.affine.setSyncingMode.deviceOnly']()}
@@ -233,7 +239,7 @@ const SetSyncingModeContent = ({ onConfirmMode(enableCloudSyncing); }} > - {t['Continue']()} + {t['com.affine.setSyncingMode.button.continue']()}
diff --git a/apps/core/src/components/affine/enable-affine-cloud-modal/index.tsx b/apps/core/src/components/affine/enable-affine-cloud-modal/index.tsx index 657ec8c1b0..8c8f1b8595 100644 --- a/apps/core/src/components/affine/enable-affine-cloud-modal/index.tsx +++ b/apps/core/src/components/affine/enable-affine-cloud-modal/index.tsx @@ -32,7 +32,7 @@ export const EnableAffineCloudModal = ({
diff --git a/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx b/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx index bb7c253447..a9b4469e92 100644 --- a/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx +++ b/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx @@ -40,10 +40,12 @@ export const WorkspaceDeleteModal = ({ - {t['Delete Workspace']()}? + + {t['com.affine.workspaceDelete.title']()}? + {workspace.flavour === WorkspaceFlavour.LOCAL ? ( - + Deleting ( {{ workspace: workspaceName } as any} @@ -54,7 +56,7 @@ export const WorkspaceDeleteModal = ({ ) : ( - + Deleting ( {{ workspace: workspaceName } as any} @@ -73,14 +75,14 @@ export const WorkspaceDeleteModal = ({ }} onChange={setDeleteStr} data-testid="delete-workspace-input" - placeholder={t['Placeholder of delete workspace']()} + placeholder={t['com.affine.workspaceDelete.placeholder']()} width={315} height={42} /> diff --git a/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/index.tsx b/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/index.tsx index e3fb76c9e6..645945fefc 100644 --- a/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/index.tsx +++ b/apps/core/src/components/affine/new-workspace-setting-detail/delete-leave-workspace/index.tsx @@ -56,11 +56,11 @@ export const DeleteLeaveWorkspace = ({ name={ {isOwner - ? t['com.affine.settings.remove-workspace']() - : t['Leave Workspace']()} + ? t['com.affine.workspaceDelete.title']() + : t['com.affine.deleteLeaveWorkspace.leave']()} } - desc={t['com.affine.settings.remove-workspace-description']()} + desc={t['com.affine.deleteLeaveWorkspace.description']()} style={{ cursor: 'pointer' }} onClick={onLeaveOrDelete} data-testid="delete-workspace-button" @@ -82,8 +82,8 @@ export const DeleteLeaveWorkspace = ({ onConfirm={onLeaveConfirm} onCancel={onCloseLeaveModal} onClose={onCloseLeaveModal} - title={`${t['Leave Workspace']()}?`} - content={t['Leave Workspace hint']()} + title={`${t['com.affine.deleteLeaveWorkspace.leave']()}?`} + content={t['com.affine.deleteLeaveWorkspace.leaveDescription']()} confirmType="warning" confirmText={t['Leave']()} /> diff --git a/apps/core/src/components/affine/new-workspace-setting-detail/index.tsx b/apps/core/src/components/affine/new-workspace-setting-detail/index.tsx index 1822150ea9..ae19c0ff99 100644 --- a/apps/core/src/components/affine/new-workspace-setting-detail/index.tsx +++ b/apps/core/src/components/affine/new-workspace-setting-detail/index.tsx @@ -73,7 +73,7 @@ export const WorkspaceSettingDetail = (props: WorkspaceSettingDetailProps) => { - + diff --git a/apps/core/src/components/affine/setting-modal/general-setting/about/index.tsx b/apps/core/src/components/affine/setting-modal/general-setting/about/index.tsx index f10ae5b006..3b9cde7217 100644 --- a/apps/core/src/components/affine/setting-modal/general-setting/about/index.tsx +++ b/apps/core/src/components/affine/setting-modal/general-setting/about/index.tsx @@ -22,25 +22,28 @@ export const AboutAffine = () => { return ( <> - - + + {runtimeConfig.enableNewSettingUnstableApi && environment.isDesktop ? ( <> + name={t['com.affine.aboutAFFiNE.checkUpdate.title']()} + desc={t['com.affine.aboutAFFiNE.checkUpdate.description']()} + /> { /> { /> { window.open(runtimeConfig.changelogUrl, '_blank'); @@ -69,14 +74,14 @@ export const AboutAffine = () => { ) : null} - + - {t['Official Website']()} + {t['com.affine.aboutAFFiNE.contact.website']()} { href="https://community.affine.pro" target="_blank" > - {t['AFFiNE Community']()} + {t['com.affine.aboutAFFiNE.contact.community']()} - +
{relatedLinks.map(({ icon, title, link }) => { return ( @@ -107,14 +112,14 @@ export const AboutAffine = () => { })}
- + - {t['Privacy']()} + {t['com.affine.aboutAFFiNE.legal.privacy']()} { href="https://affine.pro/terms" target="_blank" > - {t['Terms of Use']()} + {t['com.affine.aboutAFFiNE.legal.tos']()} diff --git a/apps/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx b/apps/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx index c1d3d02c74..77b2e98fff 100644 --- a/apps/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx +++ b/apps/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx @@ -33,13 +33,13 @@ export const ThemeSettings = () => { )} > - {t['system']()} + {t['com.affine.themeSettings.system']()} - {t['light']()} + {t['com.affine.themeSettings.light']()} - {t['dark']()} + {t['com.affine.themeSettings.dark']()} ); @@ -91,26 +91,26 @@ export const AppearanceSettings = () => { return ( <> - +
@@ -118,10 +118,8 @@ export const AppearanceSettings = () => { {environment.isDesktop ? ( { ) : null} { {runtimeConfig.enableNewSettingUnstableApi && environment.isDesktop ? ( { {windowFrameStyleOptions.map(option => { return ( - {t[option]()} + {t[`com.affine.appearanceSettings.windowFrame.${option}`]()} ); })} @@ -168,18 +164,18 @@ export const AppearanceSettings = () => { ) : null} {runtimeConfig.enableNewSettingUnstableApi ? ( - +
{ ) : null} {environment.isDesktop ? ( - + { {environment.isMacOs && ( { }, { key: 'shortcuts', - title: t['Keyboard Shortcuts'](), + title: t['com.affine.keyboardShortcuts.title'](), icon: KeyboardIcon, testId: 'shortcuts-panel-trigger', }, @@ -51,7 +51,7 @@ export const useGeneralSettingList = (): GeneralSettingList => { }, { key: 'about', - title: t['About AFFiNE'](), + title: t['com.affine.aboutAFFiNE.title'](), icon: InformationIcon, testId: 'about-panel-trigger', }, diff --git a/apps/core/src/components/affine/setting-modal/general-setting/shortcuts/index.tsx b/apps/core/src/components/affine/setting-modal/general-setting/shortcuts/index.tsx index 7ca68fc36a..aa6e0b49b8 100644 --- a/apps/core/src/components/affine/setting-modal/general-setting/shortcuts/index.tsx +++ b/apps/core/src/components/affine/setting-modal/general-setting/shortcuts/index.tsx @@ -49,8 +49,8 @@ export const Shortcuts = () => { return ( <> diff --git a/apps/core/src/components/affine/setting-modal/setting-sidebar/index.tsx b/apps/core/src/components/affine/setting-modal/setting-sidebar/index.tsx index 0ada4bd2e4..b094941fd0 100644 --- a/apps/core/src/components/affine/setting-modal/setting-sidebar/index.tsx +++ b/apps/core/src/components/affine/setting-modal/setting-sidebar/index.tsx @@ -120,8 +120,12 @@ export const SettingSidebar = ({ const loginStatus = useCurrentLoginStatus(); return (
-
{t['Settings']()}
-
{t['General']()}
+
+ {t['com.affine.settingSidebar.title']()} +
+
+ {t['com.affine.settingSidebar.settings.general']()} +
{generalSettingList.map(({ title, icon, key, testId }) => { if (!runtimeConfig.enablePlugin && key === 'plugins') { @@ -147,7 +151,7 @@ export const SettingSidebar = ({
- {t['com.affine.settings.workspace']()} + {t['com.affine.settingSidebar.settings.workspace']()}
}> diff --git a/apps/core/src/components/blocksuite/block-suite-header-title/operation-menu.tsx b/apps/core/src/components/blocksuite/block-suite-header-title/operation-menu.tsx index 48516dc8ea..52a48019be 100644 --- a/apps/core/src/components/blocksuite/block-suite-header-title/operation-menu.tsx +++ b/apps/core/src/components/blocksuite/block-suite-header-title/operation-menu.tsx @@ -60,7 +60,11 @@ export const PageMenu = ({ rename, pageId }: PageMenuProps) => { const { importFile } = usePageHelper(blockSuiteWorkspace); const handleFavorite = useCallback(() => { setPageMeta(pageId, { favorite: !favorite }); - toast(favorite ? t['Removed from Favorites']() : t['Added to Favorites']()); + toast( + favorite + ? t['com.affine.toastMessage.removedFavorites']() + : t['com.affine.toastMessage.addedFavorites']() + ); }, [favorite, pageId, setPageMeta, t]); const handleSwitchMode = useCallback(() => { setSetting(setting => ({ @@ -68,13 +72,13 @@ export const PageMenu = ({ rename, pageId }: PageMenuProps) => { })); toast( mode === 'page' - ? t['com.affine.edgelessMode']() - : t['com.affine.pageMode']() + ? t['com.affine.toastMessage.edgelessMode']() + : t['com.affine.toastMessage.pageMode']() ); }, [mode, setSetting, t]); const handleOnConfirm = useCallback(() => { removeToTrash(pageId); - toast(t['Moved to Trash']()); + toast(t['com.affine.toastMessage.movedTrash']()); setOpenConfirm(false); }, [pageId, removeToTrash, t]); const menuItemStyle = { @@ -133,7 +137,9 @@ export const PageMenu = ({ rename, pageId }: PageMenuProps) => { style={menuItemStyle} > {t['Convert to ']()} - {mode === 'page' ? t['Edgeless']() : t['Page']()} + {mode === 'page' + ? t['com.affine.pageMode.edgeless']() + : t['com.affine.pageMode.page']()} { } > - {favorite ? t['Remove from favorites']() : t['Add to Favorites']()} + {favorite + ? t['com.affine.favoritePageOperation.remove']() + : t['com.affine.favoritePageOperation.add']()} {/* {TODO: add tag and duplicate function support} */} {/* { if (setting?.mode !== 'page') { - toast(t['com.affine.pageMode']()); + toast(t['com.affine.toastMessage.pageMode']()); return { ...setting, mode: 'page' }; } else { - toast(t['com.affine.edgelessMode']()); + toast(t['com.affine.toastMessage.edgelessMode']()); return { ...setting, mode: 'edgeless' }; } }); @@ -91,7 +91,7 @@ export const EditorModeSwitch = ({ onClick={() => { setSetting(setting => { if (setting?.mode !== 'page') { - toast(t['com.affine.pageMode']()); + toast(t['com.affine.toastMessage.pageMode']()); } return { ...setting, mode: 'page' }; }); @@ -105,7 +105,7 @@ export const EditorModeSwitch = ({ onClick={() => { setSetting(setting => { if (setting?.mode !== 'edgeless') { - toast(t['com.affine.edgelessMode']()); + toast(t['com.affine.toastMessage.edgelessMode']()); } return { ...setting, mode: 'edgeless' }; }); diff --git a/apps/core/src/components/blocksuite/block-suite-page-list/index.tsx b/apps/core/src/components/blocksuite/block-suite-page-list/index.tsx index 4e9e431279..57d891e82d 100644 --- a/apps/core/src/components/blocksuite/block-suite-page-list/index.tsx +++ b/apps/core/src/components/blocksuite/block-suite-page-list/index.tsx @@ -204,11 +204,15 @@ export const BlockSuitePageList = ({ }, onRestorePage: () => { restoreFromTrash(pageMeta.id); - toast(t['restored']({ title: pageMeta.title || 'Untitled' })); + toast( + t['com.affine.toastMessage.restored']({ + title: pageMeta.title || 'Untitled', + }) + ); }, onPermanentlyDeletePage: () => { permanentlyDeletePage(pageMeta.id); - toast(t['Permanently deleted']()); + toast(t['com.affine.toastMessage.permanentlyDeleted']()); }, }; }); @@ -243,17 +247,23 @@ export const BlockSuitePageList = ({ }, removeToTrash: () => { removeToTrash(pageMeta.id); - toast(t['Successfully deleted']()); + toast(t['com.affine.toastMessage.successfullyDeleted']()); }, onRestorePage: () => { restoreFromTrash(pageMeta.id); - toast(t['restored']({ title: pageMeta.title || 'Untitled' })); + toast( + t['com.affine.toastMessage.restored']({ + title: pageMeta.title || 'Untitled', + }) + ); }, bookmarkPage: () => { const status = pageMeta.favorite; toggleFavorite(pageMeta.id); toast( - status ? t['Removed from Favorites']() : t['Added to Favorites']() + status + ? t['com.affine.toastMessage.removedFavorites']() + : t['com.affine.toastMessage.addedFavorites']() ); }, onDisablePublicSharing: () => { diff --git a/apps/core/src/components/pure/help-island/index.tsx b/apps/core/src/components/pure/help-island/index.tsx index 020ff4571f..236888184c 100644 --- a/apps/core/src/components/pure/help-island/index.tsx +++ b/apps/core/src/components/pure/help-island/index.tsx @@ -24,6 +24,7 @@ const DEFAULT_SHOW_LIST: IslandItemNames[] = [ ]; const DESKTOP_SHOW_LIST: IslandItemNames[] = [...DEFAULT_SHOW_LIST, 'guide']; export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts' | 'guide'; + export const HelpIsland = ({ showList = environment.isDesktop ? DESKTOP_SHOW_LIST : DEFAULT_SHOW_LIST, }: { @@ -61,7 +62,10 @@ export const HelpIsland = ({ style={{ height: spread ? `${showList.length * 40 + 4}px` : 0 }} > {showList.includes('whatNew') && ( - + { @@ -73,7 +77,10 @@ export const HelpIsland = ({ )} {showList.includes('contact') && ( - + )} {showList.includes('shortcuts') && ( - + { @@ -113,7 +123,10 @@ export const HelpIsland = ({ )} - + diff --git a/apps/core/src/components/pure/quick-search-modal/config.ts b/apps/core/src/components/pure/quick-search-modal/config.ts index f9d700017e..29b8033acb 100644 --- a/apps/core/src/components/pure/quick-search-modal/config.ts +++ b/apps/core/src/components/pure/quick-search-modal/config.ts @@ -34,7 +34,7 @@ export const useSwitchToConfig = (workspaceId: string): Config[] => { return useMemo( () => [ { - title: t['All pages'](), + title: t['com.affine.workspaceSubPath.all'](), subPath: WorkspaceSubPath.ALL, icon: FolderIcon, }, @@ -50,7 +50,7 @@ export const useSwitchToConfig = (workspaceId: string): Config[] => { icon: SettingsIcon, }, { - title: t['Trash'](), + title: t['com.affine.workspaceSubPath.trash'](), subPath: WorkspaceSubPath.TRASH, icon: DeleteTemporarilyIcon, }, diff --git a/apps/core/src/components/pure/trash-button-group/index.tsx b/apps/core/src/components/pure/trash-button-group/index.tsx index 6a47a9c04d..5e184320c9 100644 --- a/apps/core/src/components/pure/trash-button-group/index.tsx +++ b/apps/core/src/components/pure/trash-button-group/index.tsx @@ -39,11 +39,15 @@ export const TrashButtonGroup = () => { type="primary" onClick={() => { restoreFromTrash(pageId); - toast(t['restored']({ title: pageMeta.title || 'Untitled' })); + toast( + t['com.affine.toastMessage.restored']({ + title: pageMeta.title || 'Untitled', + }) + ); }} size="large" > - {t['Restore it']()} + {t['com.affine.trashOperation.restoreIt']()}
@@ -54,19 +58,19 @@ export const TrashButtonGroup = () => { }} size="large" > - {t['Delete permanently']()} + {t['com.affine.trashOperation.deletePermanently']()}
{ jumpToSubPath(workspace.id, WorkspaceSubPath.ALL); blockSuiteWorkspace.removePage(pageId); - toast(t['Permanently deleted']()); + toast(t['com.affine.toastMessage.permanentlyDeleted']()); }, [blockSuiteWorkspace, jumpToSubPath, pageId, workspace.id, t])} onCancel={() => { setOpen(false); diff --git a/apps/core/src/components/pure/workspace-mode-filter-tab/index.tsx b/apps/core/src/components/pure/workspace-mode-filter-tab/index.tsx index 203e3b655d..5a133cade7 100644 --- a/apps/core/src/components/pure/workspace-mode-filter-tab/index.tsx +++ b/apps/core/src/components/pure/workspace-mode-filter-tab/index.tsx @@ -21,10 +21,12 @@ export const WorkspaceModeFilterTab = () => { onValueChange={handleValueChange} > - {t['all']()} + {t['com.affine.pageMode.all']()} + + {t['com.affine.pageMode.page']()} + + {t['com.affine.pageMode.edgeless']()} - {t['Page']()} - {t['Edgeless']()} ); }; diff --git a/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx b/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx index c2e0aef789..39d6339bd0 100644 --- a/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx +++ b/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx @@ -51,7 +51,7 @@ export const AddCollectionButton = ({ onConfirm={setting.saveCollection} open={show} onClose={() => showUpdateCollection(false)} - title={t['Save as New Collection']()} + title={t['com.affine.editCollection.saveCollection']()} init={defaultCollection} /> diff --git a/apps/core/src/components/pure/workspace-slider-bar/collections/page.tsx b/apps/core/src/components/pure/workspace-slider-bar/collections/page.tsx index 019b8a2153..72aa134913 100644 --- a/apps/core/src/components/pure/workspace-slider-bar/collections/page.tsx +++ b/apps/core/src/components/pure/workspace-slider-bar/collections/page.tsx @@ -96,7 +96,7 @@ export const PageOperations = ({ ), - name: t['Delete'](), + name: t['com.affine.trashOperation.delete'](), click: () => { removeToTrash(page.id); }, diff --git a/apps/core/src/components/root-app-sidebar/index.tsx b/apps/core/src/components/root-app-sidebar/index.tsx index 6f886951f3..53c96ef2f7 100644 --- a/apps/core/src/components/root-app-sidebar/index.tsx +++ b/apps/core/src/components/root-app-sidebar/index.tsx @@ -181,7 +181,9 @@ export const RootAppSidebar = ({ path={paths.all(currentWorkspaceId)} onClick={backToAll} > - {t['All pages']()} + + {t['com.affine.workspaceSubPath.all']()} + {runtimeConfig.enableNewSettingModal ? ( - {t['Settings']()} + {t['com.affine.settingSidebar.title']()} ) : null} - + - + - + {/* fixme: remove the following spacer */}
- {t['Trash']()} + + {t['com.affine.workspaceSubPath.trash']()} + {blockSuiteWorkspace && ( diff --git a/apps/core/src/hooks/affine/use-shortcuts.ts b/apps/core/src/hooks/affine/use-shortcuts.ts index 0804af7512..0fc2497cd2 100644 --- a/apps/core/src/hooks/affine/use-shortcuts.ts +++ b/apps/core/src/hooks/affine/use-shortcuts.ts @@ -1,5 +1,67 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks'; -import { useMemo } from 'react'; +import { useCallback, useMemo } from 'react'; + +type KeyboardShortcutsI18NKeys = + | 'cancel' + | 'quickSearch' + | 'newPage' + | 'appendDailyNote' + | 'expandOrCollapseSidebar' + | 'goBack' + | 'goForward' + | 'selectAll' + | 'undo' + | 'redo' + | 'zoomIn' + | 'zoomOut' + | 'zoomTo100' + | 'zoomToFit' + | 'select' + | 'text' + | 'shape' + | 'image' + | 'straightConnector' + | 'elbowedConnector' + | 'curveConnector' + | 'pen' + | 'hand' + | 'note' + | 'group' + | 'unGroup' + | 'switch' + | 'bold' + | 'italic' + | 'underline' + | 'strikethrough' + | 'inlineCode' + | 'codeBlock' + | 'link' + | 'bodyText' + | 'increaseIndent' + | 'reduceIndent' + | 'groupDatabase' + | 'moveUp' + | 'moveDown' + | 'divider'; + +// TODO(550): remove this hook after 'useAFFiNEI18N' support scoped i18n +const useKeyboardShortcutsI18N = () => { + const t = useAFFiNEI18N(); + return useCallback( + (key: KeyboardShortcutsI18NKeys) => + t[`com.affine.keyboardShortcuts.${key}`](), + [t] + ); +}; + +// TODO(550): remove this hook after 'useAFFiNEI18N' support scoped i18n +const useHeadingKeyboardShortcutsI18N = () => { + const t = useAFFiNEI18N(); + return useCallback( + (number: string) => t['com.affine.keyboardShortcuts.heading']({ number }), + [t] + ); +}; interface ShortcutMap { [x: string]: string[]; @@ -10,205 +72,209 @@ export interface ShortcutsInfo { } export const useWinGeneralKeyboardShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Cancel']()]: ['ESC'], - [t['Quick Search']()]: ['Ctrl', 'K'], - [t['New Page']()]: ['Ctrl', 'N'], + [t('cancel')]: ['ESC'], + [t('quickSearch')]: ['Ctrl', 'K'], + [t('newPage')]: ['Ctrl', 'N'], // not implement yet - // [t['Append to Daily Note']()]: 'Ctrl + Alt + A', - [t['Expand/Collapse Sidebar']()]: ['Ctrl', '/'], + // [t('appendDailyNote')]: 'Ctrl + Alt + A', + [t('expandOrCollapseSidebar')]: ['Ctrl', '/'], // not implement yet - // [t['Go Back']()]: 'Ctrl + [', - // [t['Go Forward']()]: 'Ctrl + ]', + // [t('goBack')]: 'Ctrl + [', + // [t('goForward')]: 'Ctrl + ]', }), [t] ); }; export const useMacGeneralKeyboardShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Cancel']()]: ['ESC'], - [t['Quick Search']()]: ['⌘', 'K'], - [t['New Page']()]: ['⌘', 'N'], + [t('cancel')]: ['ESC'], + [t('quickSearch')]: ['⌘', 'K'], + [t('newPage')]: ['⌘', 'N'], // not implement yet - // [t['Append to Daily Note']()]: '⌘ + ⌥ + A', - [t['Expand/Collapse Sidebar']()]: ['⌘', '/'], + // [t('appendDailyNote')]: '⌘ + ⌥ + A', + [t('expandOrCollapseSidebar')]: ['⌘', '/'], // not implement yet - // [t['Go Back']()]: '⌘ + [', - // [t['Go Forward']()]: '⌘ + ]', + // [t('goBack')]: '⌘ + [', + // [t('goForward')]: '⌘ + ]', }), [t] ); }; export const useMacEdgelessKeyboardShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Select All']()]: ['⌘', 'A'], - [t['Undo']()]: ['⌘', 'Z'], - [t['Redo']()]: ['⌘', '⇧', 'Z'], - [t['Zoom in']()]: ['⌘', '+'], - [t['Zoom out']()]: ['⌘', '-'], - [t['Zoom to 100%']()]: ['⌘', '0'], - [t['Zoom to fit']()]: ['⌘', '1'], - [t['Select']()]: ['V'], - [t['Text']()]: ['T'], - [t['Shape']()]: ['S'], - [t['Image']()]: ['I'], - [t['Straight Connector']()]: ['L'], - [t['Elbowed Connector']()]: ['X'], + [t('selectAll')]: ['⌘', 'A'], + [t('undo')]: ['⌘', 'Z'], + [t('redo')]: ['⌘', '⇧', 'Z'], + [t('zoomIn')]: ['⌘', '+'], + [t('zoomOut')]: ['⌘', '-'], + [t('zoomTo100')]: ['⌘', '0'], + [t('zoomToFit')]: ['⌘', '1'], + [t('select')]: ['V'], + [t('text')]: ['T'], + [t('shape')]: ['S'], + [t('image')]: ['I'], + [t('straightConnector')]: ['L'], + [t('elbowedConnector')]: ['X'], // not implement yet - // [t['Curve Connector']()]: 'C', - [t['Pen']()]: ['P'], - [t['Hand']()]: ['H'], - [t['Note']()]: ['N'], + // [t('curveConnector')]: 'C', + [t('pen')]: ['P'], + [t('hand')]: ['H'], + [t('note')]: ['N'], // not implement yet - // [t['Group']()]: '⌘ + G', - // [t['Ungroup']()]: '⌘ + ⇧ + G', + // [t('group')]: '⌘ + G', + // [t('unGroup')]: '⌘ + ⇧ + G', }), [t] ); }; export const useWinEdgelessKeyboardShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Select All']()]: ['Ctrl', 'A'], - [t['Undo']()]: ['Ctrl', 'Z'], - [t['Redo']()]: ['Ctrl', 'Y/Ctrl', 'Shift', 'Z'], - [t['Zoom in']()]: ['Ctrl', '+'], - [t['Zoom out']()]: ['Ctrl', '-'], - [t['Zoom to 100%']()]: ['Ctrl', '0'], - [t['Zoom to fit']()]: ['Ctrl', '1'], - [t['Select']()]: ['V'], - [t['Text']()]: ['T'], - [t['Shape']()]: ['S'], - [t['Image']()]: ['I'], - [t['Straight Connector']()]: ['L'], - [t['Elbowed Connector']()]: ['X'], + [t('selectAll')]: ['Ctrl', 'A'], + [t('undo')]: ['Ctrl', 'Z'], + [t('redo')]: ['Ctrl', 'Y/Ctrl', 'Shift', 'Z'], + [t('zoomIn')]: ['Ctrl', '+'], + [t('zoomOut')]: ['Ctrl', '-'], + [t('zoomTo100')]: ['Ctrl', '0'], + [t('zoomToFit')]: ['Ctrl', '1'], + [t('select')]: ['V'], + [t('text')]: ['T'], + [t('shape')]: ['S'], + [t('image')]: ['I'], + [t('straightConnector')]: ['L'], + [t('elbowedConnector')]: ['X'], // not implement yet - // [t['Curve Connector']()]: 'C', - [t['Pen']()]: ['P'], - [t['Hand']()]: ['H'], - [t['Note']()]: ['N'], - [t['Switch']()]: ['Alt ', ''], + // [t('curveConnector')]: 'C', + [t('pen')]: ['P'], + [t('hand')]: ['H'], + [t('note')]: ['N'], + [t('switch')]: ['Alt ', ''], // not implement yet - // [t['Group']()]: 'Ctrl + G', - // [t['Ungroup']()]: 'Ctrl + Shift + G', + // [t('group')]: 'Ctrl + G', + // [t('unGroup')]: 'Ctrl + Shift + G', }), [t] ); }; export const useMacPageKeyboardShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); + const tH = useHeadingKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Undo']()]: ['⌘', 'Z'], - [t['Redo']()]: ['⌘', '⇧', 'Z'], - [t['Bold']()]: ['⌘', 'B'], - [t['Italic']()]: ['⌘', 'I'], - [t['Underline']()]: ['⌘', 'U'], - [t['Strikethrough']()]: ['⌘', '⇧', 'S'], - [t['Inline code']()]: ['⌘', 'E'], - [t['Code block']()]: ['⌘', '⌥', 'C'], - [t['Link']()]: ['⌘', 'K'], - [t['Quick search']()]: ['⌘', 'K'], - [t['Body text']()]: ['⌘', '⌥', '0'], - [t['Heading']({ number: '1' })]: ['⌘', '⌥', '1'], - [t['Heading']({ number: '2' })]: ['⌘', '⌥', '2'], - [t['Heading']({ number: '3' })]: ['⌘', '⌥', '3'], - [t['Heading']({ number: '4' })]: ['⌘', '⌥', '4'], - [t['Heading']({ number: '5' })]: ['⌘', '⌥', '5'], - [t['Heading']({ number: '6' })]: ['⌘', '⌥', '6'], - [t['Increase indent']()]: ['Tab'], - [t['Reduce indent']()]: ['⇧', 'Tab'], - [t['Group as Database']()]: ['⌘', 'G'], - [t['Switch']()]: ['⌥', 'S'], + [t('undo')]: ['⌘', 'Z'], + [t('redo')]: ['⌘', '⇧', 'Z'], + [t('bold')]: ['⌘', 'B'], + [t('italic')]: ['⌘', 'I'], + [t('underline')]: ['⌘', 'U'], + [t('strikethrough')]: ['⌘', '⇧', 'S'], + [t('inlineCode')]: ['⌘', 'E'], + [t('codeBlock')]: ['⌘', '⌥', 'C'], + [t('link')]: ['⌘', 'K'], + [t('quickSearch')]: ['⌘', 'K'], + [t('bodyText')]: ['⌘', '⌥', '0'], + [tH('1')]: ['⌘', '⌥', '1'], + [tH('2')]: ['⌘', '⌥', '2'], + [tH('3')]: ['⌘', '⌥', '3'], + [tH('4')]: ['⌘', '⌥', '4'], + [tH('5')]: ['⌘', '⌥', '5'], + [tH('6')]: ['⌘', '⌥', '6'], + [t('increaseIndent')]: ['Tab'], + [t('reduceIndent')]: ['⇧', 'Tab'], + [t('groupDatabase')]: ['⌘', 'G'], + [t('switch')]: ['⌥', 'S'], // not implement yet - // [t['Move Up']()]: '⌘ + ⌥ + ↑', - // [t['Move Down']()]: '⌘ + ⌥ + ↓', + // [t('moveUp')]: '⌘ + ⌥ + ↑', + // [t('moveDown')]: '⌘ + ⌥ + ↓', }), - [t] + [t, tH] ); }; export const useMacMarkdownShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); + const tH = useHeadingKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Bold']()]: ['**Text**'], - [t['Italic']()]: ['*Text*'], - [t['Underline']()]: ['~Text~'], - [t['Strikethrough']()]: ['~~Text~~'], - [t['Divider']()]: ['***'], - [t['Inline code']()]: ['`Text` '], - [t['Code block']()]: ['``` Space'], - [t['Heading']({ number: '1' })]: ['# Text'], - [t['Heading']({ number: '2' })]: ['## Text'], - [t['Heading']({ number: '3' })]: ['### Text'], - [t['Heading']({ number: '4' })]: ['#### Text'], - [t['Heading']({ number: '5' })]: ['##### Text'], - [t['Heading']({ number: '6' })]: ['###### Text'], + [t('bold')]: ['**Text**'], + [t('italic')]: ['*Text*'], + [t('underline')]: ['~Text~'], + [t('strikethrough')]: ['~~Text~~'], + [t('divider')]: ['***'], + [t('inlineCode')]: ['`Text` '], + [t('codeBlock')]: ['``` Space'], + [tH('1')]: ['# Text'], + [tH('2')]: ['## Text'], + [tH('3')]: ['### Text'], + [tH('4')]: ['#### Text'], + [tH('5')]: ['##### Text'], + [tH('6')]: ['###### Text'], }), - [t] + [t, tH] ); }; export const useWinPageKeyboardShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); + const tH = useHeadingKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Undo']()]: ['Ctrl', 'Z'], - [t['Redo']()]: ['Ctrl', 'Y'], - [t['Bold']()]: ['Ctrl', 'B'], - [t['Italic']()]: ['Ctrl', 'I'], - [t['Underline']()]: ['Ctrl', 'U'], - [t['Strikethrough']()]: ['Ctrl', 'Shift', 'S'], - [t['Inline code']()]: [' Ctrl', 'E'], - [t['Code block']()]: ['Ctrl', 'Alt', 'C'], - [t['Link']()]: ['Ctr', 'K'], - [t['Quick search']()]: ['Ctrl', 'K'], - [t['Body text']()]: ['Ctrl', 'Shift', '0'], - [t['Heading']({ number: '1' })]: ['Ctrl', 'Shift', '1'], - [t['Heading']({ number: '2' })]: ['Ctrl', 'Shift', '2'], - [t['Heading']({ number: '3' })]: ['Ctrl', 'Shift', '3'], - [t['Heading']({ number: '4' })]: ['Ctrl', 'Shift', '4'], - [t['Heading']({ number: '5' })]: ['Ctrl', 'Shift', '5'], - [t['Heading']({ number: '6' })]: ['Ctrl', 'Shift', '6'], - [t['Increase indent']()]: ['Tab'], - [t['Reduce indent']()]: ['Shift+Tab'], - [t['Group as Database']()]: ['Ctrl + G'], + [t('undo')]: ['Ctrl', 'Z'], + [t('redo')]: ['Ctrl', 'Y'], + [t('bold')]: ['Ctrl', 'B'], + [t('italic')]: ['Ctrl', 'I'], + [t('underline')]: ['Ctrl', 'U'], + [t('strikethrough')]: ['Ctrl', 'Shift', 'S'], + [t('inlineCode')]: [' Ctrl', 'E'], + [t('codeBlock')]: ['Ctrl', 'Alt', 'C'], + [t('link')]: ['Ctr', 'K'], + [t('quickSearch')]: ['Ctrl', 'K'], + [t('bodyText')]: ['Ctrl', 'Shift', '0'], + [tH('1')]: ['Ctrl', 'Shift', '1'], + [tH('2')]: ['Ctrl', 'Shift', '2'], + [tH('3')]: ['Ctrl', 'Shift', '3'], + [tH('4')]: ['Ctrl', 'Shift', '4'], + [tH('5')]: ['Ctrl', 'Shift', '5'], + [tH('6')]: ['Ctrl', 'Shift', '6'], + [t('increaseIndent')]: ['Tab'], + [t('reduceIndent')]: ['Shift+Tab'], + [t('groupDatabase')]: ['Ctrl + G'], ['Switch']: ['Alt + S'], // not implement yet - // [t['Move Up']()]: 'Ctrl + Alt + ↑', - // [t['Move Down']()]: 'Ctrl + Alt + ↓', + // [t('moveUp')]: 'Ctrl + Alt + ↑', + // [t('moveDown')]: 'Ctrl + Alt + ↓', }), - [t] + [t, tH] ); }; export const useWinMarkdownShortcuts = (): ShortcutMap => { - const t = useAFFiNEI18N(); + const t = useKeyboardShortcutsI18N(); + const tH = useHeadingKeyboardShortcutsI18N(); return useMemo( () => ({ - [t['Bold']()]: ['**Text** '], - [t['Italic']()]: ['*Text* '], - [t['Underline']()]: ['~Text~ '], - [t['Strikethrough']()]: ['~~Text~~ '], - [t['Divider']()]: ['***'], - [t['Inline code']()]: ['`Text` '], - [t['Code block']()]: ['``` Text'], - [t['Heading']({ number: '1' })]: ['# Text'], - [t['Heading']({ number: '2' })]: ['## Text'], - [t['Heading']({ number: '3' })]: ['### Text'], - [t['Heading']({ number: '4' })]: ['#### Text'], - [t['Heading']({ number: '5' })]: ['##### Text'], - [t['Heading']({ number: '6' })]: ['###### Text'], + [t('bold')]: ['**Text** '], + [t('italic')]: ['*Text* '], + [t('underline')]: ['~Text~ '], + [t('strikethrough')]: ['~~Text~~ '], + [t('divider')]: ['***'], + [t('inlineCode')]: ['`Text` '], + [t('codeBlock')]: ['``` Text'], + [tH('1')]: ['# Text'], + [tH('2')]: ['## Text'], + [tH('3')]: ['### Text'], + [tH('4')]: ['#### Text'], + [tH('5')]: ['##### Text'], + [tH('6')]: ['###### Text'], }), - [t] + [t, tH] ); }; @@ -219,7 +285,7 @@ export const useMarkdownShortcuts = (): ShortcutsInfo => { const winMarkdownShortcuts = useWinMarkdownShortcuts(); const isMac = environment.isBrowser && environment.isMacOs; return { - title: t['Markdown Syntax'](), + title: t['com.affine.shortcutsTitle.markdownSyntax'](), shortcuts: isMac ? macMarkdownShortcuts : winMarkdownShortcuts, }; }; @@ -231,7 +297,7 @@ export const usePageShortcuts = (): ShortcutsInfo => { const winPageShortcuts = useWinPageKeyboardShortcuts(); const isMac = environment.isBrowser && environment.isMacOs; return { - title: t['Page'](), + title: t['com.affine.shortcutsTitle.page'](), shortcuts: isMac ? macPageShortcuts : winPageShortcuts, }; }; @@ -243,7 +309,7 @@ export const useEdgelessShortcuts = (): ShortcutsInfo => { const winEdgelessShortcuts = useWinEdgelessKeyboardShortcuts(); const isMac = environment.isBrowser && environment.isMacOs; return { - title: t['Edgeless'](), + title: t['com.affine.shortcutsTitle.edgeless'](), shortcuts: isMac ? macEdgelessShortcuts : winEdgelessShortcuts, }; }; @@ -254,9 +320,8 @@ export const useGeneralShortcuts = (): ShortcutsInfo => { const macGeneralShortcuts = useMacGeneralKeyboardShortcuts(); const winGeneralShortcuts = useWinGeneralKeyboardShortcuts(); const isMac = environment.isBrowser && environment.isMacOs; - return { - title: t['General'](), + title: t['com.affine.shortcutsTitle.general'](), shortcuts: isMac ? macGeneralShortcuts : winGeneralShortcuts, }; }; diff --git a/apps/core/src/layouts/workspace-layout.tsx b/apps/core/src/layouts/workspace-layout.tsx index 5c5350771f..dddcdae556 100644 --- a/apps/core/src/layouts/workspace-layout.tsx +++ b/apps/core/src/layouts/workspace-layout.tsx @@ -216,7 +216,7 @@ export const WorkspaceLayoutInner = ({ children }: PropsWithChildren) => { // TODO-Doma // Co-locate `moveToTrash` with the toast for reuse, as they're always used together moveToTrash(pageId); - toast(t['Successfully deleted']()); + toast(t['com.affine.toastMessage.successfullyDeleted']()); } // Drag page into Collections processCollectionsDrag(e); diff --git a/apps/core/src/pages/404.tsx b/apps/core/src/pages/404.tsx index 8dcef1445e..0b68787ffc 100644 --- a/apps/core/src/pages/404.tsx +++ b/apps/core/src/pages/404.tsx @@ -24,14 +24,14 @@ export const StyledContainer = styled('div')(() => { }; }); -export const NotfoundPage = () => { +export const NotFoundPage = () => { const t = useAFFiNEI18N(); const { jumpToSubPath, jumpToIndex } = useNavigateHelper(); return ( 404 -

{t['404 - Page Not Found']()}

+

{t['com.affine.notFoundPage.title']()}

); }; export const Component = (): ReactElement => { - return ; + return ; }; diff --git a/packages/component/src/components/app-sidebar/app-updater-button/index.tsx b/packages/component/src/components/app-sidebar/app-updater-button/index.tsx index 5c90f45f91..1d927594c5 100644 --- a/packages/component/src/components/app-sidebar/app-updater-button/index.tsx +++ b/packages/component/src/components/app-sidebar/app-updater-button/index.tsx @@ -114,8 +114,8 @@ export function AppUpdaterButtonPure({
{!updateReady - ? t['com.affine.updater.downloading']() - : t['com.affine.updater.update-available']()} + ? t['com.affine.appUpdater.downloading']() + : t['com.affine.appUpdater.updateAvailable']()} {updateAvailable?.version} @@ -127,7 +127,7 @@ export function AppUpdaterButtonPure({ {t[ - appQuitting ? 'Loading' : 'com.affine.updater.restart-to-update' + appQuitting ? 'Loading' : 'com.affine.appUpdater.installUpdate' ]()}
@@ -136,7 +136,7 @@ export function AppUpdaterButtonPure({
+ />
)}
@@ -148,7 +148,7 @@ export function AppUpdaterButtonPure({ <>
- {t['com.affine.updater.update-available']()} + {t['com.affine.appUpdater.updateAvailable']()} {updateAvailable?.version} @@ -157,7 +157,7 @@ export function AppUpdaterButtonPure({
- {t['com.affine.updater.open-download-page']()} + {t['com.affine.appUpdater.openDownloadPage']()}
@@ -170,7 +170,7 @@ export function AppUpdaterButtonPure({
- {t[`Discover what's new!`]()} + {t['com.affine.appUpdater.whatsNew']()}
{ const [open, setOpen] = useAtom(appSidebarOpenAtom); const t = useAFFiNEI18N(); const ref = useRef(null); - const tooltipContent = open ? t['Collapse sidebar']() : t['Expand sidebar'](); + const tooltipContent = open + ? t['com.affine.sidebarSwitch.collapse']() + : t['com.affine.sidebarSwitch.expand'](); const collapseKeyboardShortcuts = environment.isBrowser && environment.isMacOs ? ' ⌘+/' : ' Ctrl+/'; diff --git a/packages/component/src/components/auth-components/back-button.tsx b/packages/component/src/components/auth-components/back-button.tsx index 4708a70b3a..a63d417902 100644 --- a/packages/component/src/components/auth-components/back-button.tsx +++ b/packages/component/src/components/auth-components/back-button.tsx @@ -18,7 +18,7 @@ export const BackButton: FC = props => { icon={} {...props} > - {t['Back Home']()} + {t['com.affine.backButton']()} ); }; diff --git a/packages/component/src/components/card/workspace-card/index.tsx b/packages/component/src/components/card/workspace-card/index.tsx index 311e0be988..5911625013 100644 --- a/packages/component/src/components/card/workspace-card/index.tsx +++ b/packages/component/src/components/card/workspace-card/index.tsx @@ -26,19 +26,28 @@ const WorkspaceType = ({ flavour }: WorkspaceTypeProps) => { if (flavour === WorkspaceFlavour.LOCAL) { return ( -

- {t['Local Workspace']()} +

+ {t['com.affine.workspaceType.local']()}

); } return isOwner ? ( -

- {t['Cloud Workspace']()} +

+ {t['com.affine.workspaceType.cloud']()}

) : ( -

- {t['Joined Workspace']()} +

+ {t['com.affine.workspaceType.joined']()}

); }; @@ -86,7 +95,7 @@ export const WorkspaceCard = ({ {/* {meta.flavour === WorkspaceFlavour.LOCAL && ( -

+

diff --git a/packages/component/src/components/member-components/invite-modal.tsx b/packages/component/src/components/member-components/invite-modal.tsx index e0531e2c2f..b5479f2256 100644 --- a/packages/component/src/components/member-components/invite-modal.tsx +++ b/packages/component/src/components/member-components/invite-modal.tsx @@ -135,7 +135,7 @@ export const InviteModal = ({
) : ( diff --git a/packages/component/src/components/page-list/operation-cell.tsx b/packages/component/src/components/page-list/operation-cell.tsx index 8b1f8fde7d..e2ff765f9d 100644 --- a/packages/component/src/components/page-list/operation-cell.tsx +++ b/packages/component/src/components/page-list/operation-cell.tsx @@ -61,7 +61,9 @@ export const OperationCell = ({ } > - {favorite ? t['Remove from favorites']() : t['Add to Favorites']()} + {favorite + ? t['com.affine.favoritePageOperation.remove']() + : t['com.affine.favoritePageOperation.add']()} {!isDesktop && ( } > - {t['Open in new tab']()} + {t['com.affine.openPageOperation.newTab']()} )} - + { @@ -141,7 +143,11 @@ export const TrashOperationCell = ({ - + { setOpen(true); @@ -151,9 +157,9 @@ export const TrashOperationCell = ({ { diff --git a/packages/component/src/components/page-list/operation-menu-items/move-to-trash.tsx b/packages/component/src/components/page-list/operation-menu-items/move-to-trash.tsx index f98d31663e..fcddaede28 100644 --- a/packages/component/src/components/page-list/operation-menu-items/move-to-trash.tsx +++ b/packages/component/src/components/page-list/operation-menu-items/move-to-trash.tsx @@ -8,6 +8,7 @@ import { import type { ConfirmProps } from '../../..'; import { Confirm } from '../../..'; + export const MoveToTrash = (props: MenuItemProps) => { const t = useAFFiNEI18N(); @@ -21,7 +22,7 @@ export const MoveToTrash = (props: MenuItemProps) => { type="danger" {...props} > - {t['Move to Trash']()} + {t['com.affine.moveToTrash.title']()} ); }; @@ -36,8 +37,8 @@ const ConfirmModal = ({ return ( { style={{ border: 'none', position: 'static' }} onClick={() => setting.backToAll()} > - {t['Back to all']()} + {t['com.affine.collectionBar.backToAll']()} diff --git a/packages/component/src/components/page-list/view/create-collection.tsx b/packages/component/src/components/page-list/view/create-collection.tsx index 32bd9833ae..3075370108 100644 --- a/packages/component/src/components/page-list/view/create-collection.tsx +++ b/packages/component/src/components/page-list/view/create-collection.tsx @@ -68,7 +68,7 @@ export const EditCollectionModel = ({
- {title ?? t['Update Collection']()} + {title ?? t['com.affine.editCollection.updateCollection']()}
-
{t['Filters']()}
+
+ {t['com.affine.editCollection.filters']()} +
onChange({ ...value, name })} /> @@ -242,7 +244,7 @@ export const EditCollection = ({ }} >
@@ -297,10 +299,10 @@ export const SaveCollectionButton = ({ size="large" style={{ padding: '7px 8px' }} > - {t['Save as New Collection']()} + {t['com.affine.editCollection.saveCollection']()}
- {t['Disable Public Link']()} + {t['com.affine.publicLinkDisableModal.title']()}
- {t['Disable Public Link Description']()} + + {t['com.affine.publicLinkDisableModal.description']()} +
@@ -44,7 +46,7 @@ export const PublicLinkDisableModal = ({ onClose(); }} > - {t['Disable']()} + {t['com.affine.publicLinkDisableModal.button.disable']()}
diff --git a/packages/component/src/components/share-menu/share-page.tsx b/packages/component/src/components/share-menu/share-page.tsx index 908a72b5ea..9c9401130c 100644 --- a/packages/component/src/components/share-menu/share-page.tsx +++ b/packages/component/src/components/share-menu/share-page.tsx @@ -160,14 +160,14 @@ export const AffineSharePage = (props: ShareMenuProps) => { value={'page'} spanStyle={styles.spanStyle} > - {t['Page']()} + {t['com.affine.pageMode.page']()} - {t['Edgeless']()} + {t['com.affine.pageMode.edgeless']()}
diff --git a/packages/component/src/ui/confirm/confirm.tsx b/packages/component/src/ui/confirm/confirm.tsx index 01e4cc0242..7b977b5b14 100644 --- a/packages/component/src/ui/confirm/confirm.tsx +++ b/packages/component/src/ui/confirm/confirm.tsx @@ -41,7 +41,9 @@ export const Confirm = ({ }: ConfirmProps) => { const t = useAFFiNEI18N(); const cancelText_ = useMemo(() => { - return cancelText === 'Cancel' ? t['Cancel']() : cancelText; + return cancelText === 'Cancel' + ? t['com.affine.confirmModal.button.cancel']() + : cancelText; }, [cancelText, t]); const handleCancel = useCallback(() => { diff --git a/packages/component/src/ui/modal/confirm-modal.tsx b/packages/component/src/ui/modal/confirm-modal.tsx index 43041cc74f..74ca34911d 100644 --- a/packages/component/src/ui/modal/confirm-modal.tsx +++ b/packages/component/src/ui/modal/confirm-modal.tsx @@ -60,7 +60,7 @@ export const ConfirmModal = ({ {content}