From cb47053b1f5b73b9540a1d8a082333acec30d257 Mon Sep 17 00:00:00 2001 From: xudaotutou <13435638964@163.com> Date: Fri, 19 Jul 2024 11:37:36 +0800 Subject: [PATCH] fix:update copywriting --- .../desktop/public/locales/en/common.json | 4 +- frontend/desktop/public/locales/en/error.json | 1 + .../desktop/public/locales/zh/common.json | 6 +- frontend/desktop/public/locales/zh/error.json | 1 + .../AccountCenter/SmsModify/SmsBind.tsx | 4 +- .../AccountCenter/SmsModify/SmsChange.tsx | 3 +- .../AccountCenter/SmsModify/SmsUnbind.tsx | 4 +- .../account/AccountCenter/index.tsx | 3 +- .../mergeUser/NeedToMergeModal.tsx | 9 +- .../src/components/team/RemoveMember.tsx | 4 +- .../desktop/src/components/team/userTable.tsx | 8 +- frontend/desktop/src/pages/api/dev/migrate.ts | 549 ------------------ .../src/pages/api/dev/migrateInvoice.ts | 90 --- .../src/pages/api/dev/removeDuplicates.ts | 145 ----- .../applaunchpad/next-i18next.config.js | 2 +- .../costcenter/.vscode/settings.json | 7 + frontend/providers/license/next.config.js | 14 +- .../objectstorage/.vscode/settings.json | 6 + 18 files changed, 55 insertions(+), 805 deletions(-) delete mode 100644 frontend/desktop/src/pages/api/dev/migrate.ts delete mode 100644 frontend/desktop/src/pages/api/dev/migrateInvoice.ts delete mode 100644 frontend/desktop/src/pages/api/dev/removeDuplicates.ts create mode 100644 frontend/providers/costcenter/.vscode/settings.json create mode 100644 frontend/providers/objectstorage/.vscode/settings.json diff --git a/frontend/desktop/public/locales/en/common.json b/frontend/desktop/public/locales/en/common.json index e10bca2cf3f..17f21865135 100644 --- a/frontend/desktop/public/locales/en/common.json +++ b/frontend/desktop/public/locales/en/common.json @@ -45,7 +45,6 @@ "delete_account_caution": "Once a resource is deleted, it cannot be recovered. \nTherefore, before performing the above operations, please be sure to back up your data.", "delete_account_tips": "Permanently delete this account and all its content.", "delete_account_title": "Logout prompt", - "delete_account_tips2": "The account you are trying to bind has been used by another user. You can choose to merge the accounts to unify the management of your information and settings. Would you like to merge the accounts now?", "deleteaccounttitle": "Sealos will permanently delete this account.", "deletemyaccount": "DeleteMyAccount", "deploy_an_application": "Let’s deploy an application~", @@ -103,7 +102,8 @@ "memory": "Memory", "merge": "merge", "merge_account_title": "Account has been bound", - "mergeaccounttips1": "The account you are trying to bind has been used by another user. Due to conflicting binding methods, the accounts cannot be merged.", + "merge_account_tips1": "The account you are trying to bind has been used by another user. Due to conflicting binding methods, the accounts cannot be merged.", + "merge_account_tips2": "The account you are trying to bind has been used by another user. You can choose to merge accounts to manage your information and settings in a unified way. After the merge is completed, your private workspace may be converted into a regular workspace. Do you want to merge accounts now?", "message_center": "Message Center", "monitor": "Monitor", "more_apps": "More Apps", diff --git a/frontend/desktop/public/locales/en/error.json b/frontend/desktop/public/locales/en/error.json index caef159d793..c835d5c6b37 100644 --- a/frontend/desktop/public/locales/en/error.json +++ b/frontend/desktop/public/locales/en/error.json @@ -7,6 +7,7 @@ "INTERNAL_SERVER_ERROR": "Internal server error", "INSUFFICENT_BALANCE": "Insufficient balance", "ACCOUNT_NOT_FOUND": "Account not found", + "MERGET_USER_INSUFFICENT_BALANCE":"Insufficient balance in the merged account", "USER_CR_NOT_FOUND": "User CR not found", "OAUTHPROVIDER_NOT_FOUND": "OAuth provider not found", "PRIVATE_WORKSPACE_NOT_FOUND": "Private workspace not found", diff --git a/frontend/desktop/public/locales/zh/common.json b/frontend/desktop/public/locales/zh/common.json index 25f0d3f23a6..3c099f76567 100644 --- a/frontend/desktop/public/locales/zh/common.json +++ b/frontend/desktop/public/locales/zh/common.json @@ -42,8 +42,7 @@ "delete_account_caution": "资源一旦删除,将不可恢复。因此,在执行以上操作前,请务必做好数据备份工作", "delete_account_tips": "将永久删除此账户及其所有内容", "delete_account_title": "注销提示", - "delete_account_tips2": "您尝试绑定的账号已被其他用户使用。您可以选择合并账户,以统一管理您的信息和设置。是否现在合并账户?", - "deleteaccounttitle": "Sealos 将永久删除此账户。", +"deleteaccounttitle": "Sealos 将永久删除此账户。", "deletemyaccount": "删除我的账号", "deploy_an_application": "来部署一个应用吧~", "description": "描述", @@ -99,7 +98,8 @@ "memory": "内存", "merge": "合并", "merge_account_title": "账户已被绑定", - "mergeaccounttips1": "您尝试绑定的账号已被其他用户使用。由于存在冲突的其他绑定方式,无法合并账户。", + "merge_account_tips1": "您尝试绑定的账号已被其他用户使用。由于存在冲突的其他绑定方式,无法合并账户。", + "merge_account_tips2": "您尝试绑定的账号已被其他用户使用。您可以选择合并账户,以统一管理您的信息和设置。 在合并完成后,个人空间有可能转化为普通的工作空间,是否现在合并账户?", "message_center": "消息中心", "monitor": "监控", "more_apps": "更多应用", diff --git a/frontend/desktop/public/locales/zh/error.json b/frontend/desktop/public/locales/zh/error.json index 58dbfcb779b..3d93a8e47ae 100644 --- a/frontend/desktop/public/locales/zh/error.json +++ b/frontend/desktop/public/locales/zh/error.json @@ -6,6 +6,7 @@ "RESULT_SUCCESS": "响应成功", "INTERNAL_SERVER_ERROR": "内部服务器错误", "INSUFFICENT_BALANCE": "余额不足", + "MERGET_USER_INSUFFICENT_BALANCE": "被合并的账户余额不足", "ACCOUNT_NOT_FOUND": "未找到账户", "USER_CR_NOT_FOUND": "未找到用户CR", "OAUTHPROVIDER_NOT_FOUND": "未找到OAuth提供程序", diff --git a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx index 7c0720114fd..2da2083da0c 100644 --- a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx @@ -149,7 +149,9 @@ const smsBindGen = (smsType: SmsType) => > - {smsType === 'phone' ? t('common:phone') : t('common:email')} + + {smsType === 'phone' ? t('common:phone') : t('common:email')} + > - {smsType === 'phone' ? t('common:phone') : t('common:email')} + + {smsType === 'phone' ? t('common:phone') : t('common:email')} + ) { else if (pageState === PageState.PASSWORD) return t('common:changepassword'); else if (Object.values(PhoneState).includes(pageState as PhoneState)) return t('common:changephone'); // bind or unbind - else if (Object.values(EmailState).includes(pageState as EmailState)) return t('common:changeemail'); + else if (Object.values(EmailState).includes(pageState as EmailState)) + return t('common:changeemail'); else return ''; }, [t, pageState]); const queryClient = useQueryClient(); diff --git a/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx b/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx index f857b25834e..703e7e177de 100644 --- a/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx @@ -41,6 +41,11 @@ function NeedToMerge({ ...props }: BoxProps & {}) { queryClient.clear(); }, onError(err: { message: ValueOf }) { + const errMessage = + err.message === USER_MERGE_STATUS.INSUFFICENT_BALANCE + ? err.message + : 'MERGET_USER_INSUFFICENT_BALANCE'; + toast({ status: 'error', title: t(err.message as I18nErrorKey, { ns: 'error' }) @@ -83,8 +88,8 @@ function NeedToMerge({ ...props }: BoxProps & {}) { {mergeUserStatus === MergeUserStatus.CONFLICT - ? t('common:mergeaccounttips1') - : t('common:delete_account_tips2')} + ? t('common:merge_account_tips1') + : t('common:merge_account_tips2')} {mergeUserStatus === MergeUserStatus.CONFLICT ? ( diff --git a/frontend/desktop/src/components/team/RemoveMember.tsx b/frontend/desktop/src/components/team/RemoveMember.tsx index 535f9eeaebd..58b1e8f1b07 100644 --- a/frontend/desktop/src/components/team/RemoveMember.tsx +++ b/frontend/desktop/src/components/team/RemoveMember.tsx @@ -60,7 +60,9 @@ export default function RemoveMember({ ? t('common:quit') : t('common:remove'); const removeTips = - selfUserCrUid === targetUserCrUid ? t('common:quit_workspace_tips') : t('common:remove_member_tips'); + selfUserCrUid === targetUserCrUid + ? t('common:quit_workspace_tips') + : t('common:remove_member_tips'); return ( <>