From a8d201b9e3e4d312c3501b8ef0beb1d220a61f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A7=80=E7=8E=B2?= Date: Tue, 17 Jul 2018 10:00:06 +0800 Subject: [PATCH] translate error page --- src/components/Exception/index.js | 7 +++++-- src/locales/en-US.js | 9 +++++++++ src/locales/zh-CN.js | 8 ++++++++ src/pages/Result/Error.js | 32 +++++++++++++++++++++++-------- 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/components/Exception/index.js b/src/components/Exception/index.js index 14703e34..e64a961a 100644 --- a/src/components/Exception/index.js +++ b/src/components/Exception/index.js @@ -1,4 +1,5 @@ import React, { createElement } from 'react'; +import { injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import { Button } from 'antd'; import config from './typeConfig'; @@ -26,7 +27,9 @@ const Exception = ({ className, linkElement = 'a', type, title, desc, img, actio to: '/', href: '/', }, - + )} @@ -34,4 +37,4 @@ const Exception = ({ className, linkElement = 'a', type, title, desc, img, actio ); }; -export default Exception; +export default injectIntl(Exception); diff --git a/src/locales/en-US.js b/src/locales/en-US.js index b3decf2f..b0b2f3f6 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -129,4 +129,13 @@ export default { 'app.exception.description.403': "Sorry, you don't have access to this page", 'app.exception.description.404': 'Sorry, the page you visited does not exist', 'app.exception.description.500': 'Sorry, the server is reporting an error', + 'app.result.error.title': 'Submission Failed', + 'app.result.error.description': + 'Please check and modify the following information before resubmitting.', + 'app.result.error.hint-title': 'The content you submitted has the following error:', + 'app.result.error.hint-text1': 'Your account has been frozen', + 'app.result.error.hint-btn1': 'Thaw immediately', + 'app.result.error.hint-text2': 'Your account is not yet eligible to apply', + 'app.result.error.hint-btn2': 'Upgrade immediately', + 'app.result.error.btn-text': 'Return to modify', }; diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index b8da6e95..5876b8b4 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -125,4 +125,12 @@ export default { 'app.exception.description.403': '抱歉,你无权访问该页面', 'app.exception.description.404': '抱歉,你访问的页面不存在', 'app.exception.description.500': '抱歉,服务器出错了', + 'app.result.error.title': '提交失败', + 'app.result.error.description': '请核对并修改以下信息后,再重新提交。', + 'app.result.error.hint-title': '您提交的内容有如下错误:', + 'app.result.error.hint-text1': '您的账户已被冻结', + 'app.result.error.hint-btn1': '立即解冻', + 'app.result.error.hint-text2': '您的账户还不具备申请资格', + 'app.result.error.hint-btn2': '立即升级', + 'app.result.error.btn-text': '返回修改', }; diff --git a/src/pages/Result/Error.js b/src/pages/Result/Error.js index fc33129d..dcb37066 100644 --- a/src/pages/Result/Error.js +++ b/src/pages/Result/Error.js @@ -1,4 +1,5 @@ import React, { Fragment } from 'react'; +import { formatMessage, FormattedMessage } from 'umi/locale'; import { Button, Icon, Card } from 'antd'; import Result from 'components/Result'; import PageHeaderLayout from '../layouts/PageHeaderLayout'; @@ -13,34 +14,49 @@ const extra = ( marginBottom: 16, }} > - 您提交的内容有如下错误: +
- 您的账户已被冻结 + - 立即解冻 + +
- 您的账户还不具备申请资格 + - 立即升级 + +
); -const actions = ; +const actions = ( + +); export default () => (