From 966b4e3459badc5eb3952c8b6bdcc6d1db8c6974 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 23 Aug 2022 09:11:20 +0800 Subject: [PATCH] fix: translation --- packages/core/client/src/locale/en_US.ts | 1 + packages/core/client/src/locale/zh_CN.ts | 1 + packages/core/client/src/user/SignupPage.tsx | 10 ++++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/locale/en_US.ts b/packages/core/client/src/locale/en_US.ts index 66bbdfb31..62a3015e3 100644 --- a/packages/core/client/src/locale/en_US.ts +++ b/packages/core/client/src/locale/en_US.ts @@ -555,4 +555,5 @@ export default { "View all plugins": "View all plugins", "Print": "Print", 'Single select and radio fields can be used as the grouping field': 'Single select and radio fields can be used as the grouping field', + 'Sign up successfully, and automatically jump to the sign in page': 'Sign up successfully, and automatically jump to the sign in page', } diff --git a/packages/core/client/src/locale/zh_CN.ts b/packages/core/client/src/locale/zh_CN.ts index c9739798d..6cd2b718e 100644 --- a/packages/core/client/src/locale/zh_CN.ts +++ b/packages/core/client/src/locale/zh_CN.ts @@ -659,4 +659,5 @@ export default { "Enabled languages": "启用的语言", "View all plugins": "查看所有插件", "Print": "打印", + 'Sign up successfully, and automatically jump to the sign in page': '注册成功,即将跳转到登录页面', } diff --git a/packages/core/client/src/user/SignupPage.tsx b/packages/core/client/src/user/SignupPage.tsx index 031288995..900d5d584 100644 --- a/packages/core/client/src/user/SignupPage.tsx +++ b/packages/core/client/src/user/SignupPage.tsx @@ -2,6 +2,7 @@ import { ISchema, useForm } from '@formily/react'; import { uid } from '@formily/shared'; import { message } from 'antd'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import { Redirect, useHistory } from 'react-router-dom'; import { SchemaComponent, useAPIClient, useCurrentDocumentTitle, useSystemSettings } from '..'; import VerificationCode from './VerificationCode'; @@ -26,7 +27,7 @@ const schema: ISchema = { 'x-validator': 'phone', 'x-decorator': 'FormItem', 'x-component-props': { placeholder: '{{t("Phone")}}', style: {} }, - 'x-visible': '{{smsAuthEnabled}}' + 'x-visible': '{{smsAuthEnabled}}', }, code: { type: 'string', @@ -37,7 +38,7 @@ const schema: ISchema = { targetFieldName: 'phone', }, 'x-decorator': 'FormItem', - 'x-visible': '{{smsAuthEnabled}}' + 'x-visible': '{{smsAuthEnabled}}', }, password: { type: 'string', @@ -110,13 +111,14 @@ export const useSignup = () => { const history = useHistory(); const form = useForm(); const api = useAPIClient(); + const { t } = useTranslation(); return { async run() { await form.submit(); await api.resource('users').signup({ values: form.values, }); - message.success('注册成功,即将跳转登录页'); + message.success('Sign up successfully, and automatically jump to the sign in page'); setTimeout(() => { history.push('/signin'); }, 2000); @@ -135,7 +137,7 @@ export const SignupPage = () => {