diff --git a/packages/frontend/core/src/desktop/dialogs/setting/account-setting/delete-account.tsx b/packages/frontend/core/src/desktop/dialogs/setting/account-setting/delete-account.tsx index 68dc55133..23b371216 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/account-setting/delete-account.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/account-setting/delete-account.tsx @@ -3,7 +3,7 @@ import { SettingRow, SettingWrapper, } from '@affine/component/setting-components'; -import { AuthService } from '@affine/core/modules/cloud'; +import { AuthService, ServerService } from '@affine/core/modules/cloud'; import { WorkspacesService } from '@affine/core/modules/workspace'; import { UserFriendlyError } from '@affine/error'; import { Trans, useI18n } from '@affine/i18n'; @@ -18,6 +18,7 @@ import * as styles from './style.css'; export const DeleteAccount = () => { const t = useI18n(); + const serverService = useService(ServerService); const workspacesService = useService(WorkspacesService); const workspaceProfiles = workspacesService.getAllWorkspaceProfile(); const isTeamWorkspaceOwner = workspaceProfiles.some( @@ -33,7 +34,9 @@ export const DeleteAccount = () => { - {t['com.affine.setting.account.delete']()} + {t['com.affine.setting.account.delete-from-server']({ + server: serverService.server.config$.value.serverName, + })} } desc={t['com.affine.setting.account.delete.message']()} @@ -96,6 +99,7 @@ const DeleteAccountModal = ({ const authService = useService(AuthService); const session = authService.session; const account = useLiveData(session.account$); + const serverService = useService(ServerService); const [email, setEmail] = useState(''); const [isLoading, setIsLoading] = useState(false); @@ -128,9 +132,22 @@ const DeleteAccountModal = ({ onConfirm={onDeleteAccountConfirm} onOpenChange={onOpenChange} title={t['com.affine.setting.account.delete.confirm-title']()} - description={t[ - 'com.affine.setting.account.delete.confirm-description-1' - ]()} + description={ + , + }} + values={{ + server: + serverService.server.id !== 'affine-cloud' + ? `${serverService.server.config$.value.serverName} (${serverService.server.baseUrl})` + : serverService.server.config$.value.serverName, + }} + /> + } confirmText={t['com.affine.setting.account.delete.confirm-button']()} confirmButtonOptions={{ variant: 'error', @@ -140,7 +157,7 @@ const DeleteAccountModal = ({ childrenContentClassName={styles.confirmContent} > , }} diff --git a/packages/frontend/i18n/src/i18n.gen.ts b/packages/frontend/i18n/src/i18n.gen.ts index 9640462b6..d781ab015 100644 --- a/packages/frontend/i18n/src/i18n.gen.ts +++ b/packages/frontend/i18n/src/i18n.gen.ts @@ -4838,9 +4838,11 @@ export function useAFFiNEI18N(): { */ ["com.affine.setting.account"](): string; /** - * `Delete your account` + * `Delete your account from {{server}}` */ - ["com.affine.setting.account.delete"](): string; + ["com.affine.setting.account.delete-from-server"](options: { + readonly server: string; + }): string; /** * `Once deleted, your account will no longer be accessible, and all data in your personal cloud space will be permanently deleted.` */ @@ -4857,10 +4859,6 @@ export function useAFFiNEI18N(): { * `Delete your account?` */ ["com.affine.setting.account.delete.confirm-title"](): string; - /** - * `Are you sure you want to delete your account?` - */ - ["com.affine.setting.account.delete.confirm-description-1"](): string; /** * `Please type your email to confirm` */ @@ -9291,10 +9289,18 @@ export const TypedTrans: { }, { ["1"]: JSX.Element; }>>; + /** + * `Are you sure you want to delete your account from <1>{{server}}?` + */ + ["com.affine.setting.account.delete.confirm-delete-description-1"]: ComponentType>; /** * `Your account will be inaccessible, and your personal cloud space will be permanently deleted. You can remove local data by uninstalling the app or clearing your browser storage. <1>This action is irreversible.` */ - ["com.affine.setting.account.delete.confirm-description-2"]: ComponentType, { + ["com.affine.setting.account.delete.confirm-delete-description-2"]: ComponentType, { ["1"]: JSX.Element; }>>; /** diff --git a/packages/frontend/i18n/src/resources/en.json b/packages/frontend/i18n/src/resources/en.json index aa241af58..3cdcd6a98 100644 --- a/packages/frontend/i18n/src/resources/en.json +++ b/packages/frontend/i18n/src/resources/en.json @@ -1202,13 +1202,13 @@ "com.affine.setting.notifications.email.comments.title": "Comments", "com.affine.setting.notifications.email.comments.subtitle": "You will be notified through email when other members of the workspace comment on your docs.", "com.affine.setting.account": "Account settings", - "com.affine.setting.account.delete": "Delete your account", + "com.affine.setting.account.delete-from-server": "Delete your account from {{server}}", "com.affine.setting.account.delete.message": "Once deleted, your account will no longer be accessible, and all data in your personal cloud space will be permanently deleted.", "com.affine.setting.account.delete.team-warning-title": "Cannot delete account", "com.affine.setting.account.delete.team-warning-description": "You’re the owner of a team workspace. To delete your account, please delete the workspace or transfer ownership first.", "com.affine.setting.account.delete.confirm-title": "Delete your account?", - "com.affine.setting.account.delete.confirm-description-1": "Are you sure you want to delete your account?", - "com.affine.setting.account.delete.confirm-description-2": "Your account will be inaccessible, and your personal cloud space will be permanently deleted. You can remove local data by uninstalling the app or clearing your browser storage. <1>This action is irreversible.", + "com.affine.setting.account.delete.confirm-delete-description-1": "Are you sure you want to delete your account from <1>{{server}}?", + "com.affine.setting.account.delete.confirm-delete-description-2": "Your account will be inaccessible, and your personal cloud space will be permanently deleted. You can remove local data by uninstalling the app or clearing your browser storage. <1>This action is irreversible.", "com.affine.setting.account.delete.input-placeholder": "Please type your email to confirm", "com.affine.setting.account.delete.confirm-button": "Delete", "com.affine.setting.account.delete.success-title": "Account deleted",