Commit a8d201b9 authored by 张秀玲's avatar 张秀玲

translate error page

parent d8b3214a
import React, { createElement } from 'react'; import React, { createElement } from 'react';
import { injectIntl, FormattedMessage } from 'react-intl';
import classNames from 'classnames'; import classNames from 'classnames';
import { Button } from 'antd'; import { Button } from 'antd';
import config from './typeConfig'; import config from './typeConfig';
...@@ -26,7 +27,9 @@ const Exception = ({ className, linkElement = 'a', type, title, desc, img, actio ...@@ -26,7 +27,9 @@ const Exception = ({ className, linkElement = 'a', type, title, desc, img, actio
to: '/', to: '/',
href: '/', href: '/',
}, },
<Button type="primary">返回首页</Button> <Button type="primary">
<FormattedMessage id="app.exception.back" defaultMessage="Back to home" />
</Button>
)} )}
</div> </div>
</div> </div>
...@@ -34,4 +37,4 @@ const Exception = ({ className, linkElement = 'a', type, title, desc, img, actio ...@@ -34,4 +37,4 @@ const Exception = ({ className, linkElement = 'a', type, title, desc, img, actio
); );
}; };
export default Exception; export default injectIntl(Exception);
...@@ -129,4 +129,13 @@ export default { ...@@ -129,4 +129,13 @@ export default {
'app.exception.description.403': "Sorry, you don't have access to this page", '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.404': 'Sorry, the page you visited does not exist',
'app.exception.description.500': 'Sorry, the server is reporting an error', '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',
}; };
...@@ -125,4 +125,12 @@ export default { ...@@ -125,4 +125,12 @@ export default {
'app.exception.description.403': '抱歉,你无权访问该页面', 'app.exception.description.403': '抱歉,你无权访问该页面',
'app.exception.description.404': '抱歉,你访问的页面不存在', 'app.exception.description.404': '抱歉,你访问的页面不存在',
'app.exception.description.500': '抱歉,服务器出错了', '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': '返回修改',
}; };
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale';
import { Button, Icon, Card } from 'antd'; import { Button, Icon, Card } from 'antd';
import Result from 'components/Result'; import Result from 'components/Result';
import PageHeaderLayout from '../layouts/PageHeaderLayout'; import PageHeaderLayout from '../layouts/PageHeaderLayout';
...@@ -13,34 +14,49 @@ const extra = ( ...@@ -13,34 +14,49 @@ const extra = (
marginBottom: 16, marginBottom: 16,
}} }}
> >
您提交的内容有如下错误 <FormattedMessage
id="app.result.error.hint-title"
defaultMessage="The content you submitted has the following error:"
/>
</div> </div>
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
<Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle-o" /> <Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle-o" />
您的账户已被冻结 <FormattedMessage
id="app.result.error.hint-text1"
defaultMessage="Your account has been frozen"
/>
<a style={{ marginLeft: 16 }}> <a style={{ marginLeft: 16 }}>
立即解冻 <Icon type="right" /> <FormattedMessage id="app.result.error.hint-btn1" defaultMessage="Thaw immediately" />
<Icon type="right" />
</a> </a>
</div> </div>
<div> <div>
<Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle-o" /> <Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle-o" />
您的账户还不具备申请资格 <FormattedMessage
id="app.result.error.hint-text2"
defaultMessage="Your account is not yet eligible to apply"
/>
<a style={{ marginLeft: 16 }}> <a style={{ marginLeft: 16 }}>
立即升级 <Icon type="right" /> <FormattedMessage id="app.result.error.hint-btn2" defaultMessage="Upgrade immediately" />
<Icon type="right" />
</a> </a>
</div> </div>
</Fragment> </Fragment>
); );
const actions = <Button type="primary">返回修改</Button>; const actions = (
<Button type="primary">
<FormattedMessage id="app.result.error.btn-text" defaultMessage="Return to modify" />
</Button>
);
export default () => ( export default () => (
<PageHeaderLayout> <PageHeaderLayout>
<Card bordered={false}> <Card bordered={false}>
<Result <Result
type="error" type="error"
title="提交失败" title={formatMessage({ id: 'app.result.error.title' }, {})}
description="请核对并修改以下信息后,再重新提交。" description={formatMessage({ id: 'app.result.error.description' }, {})}
extra={extra} extra={extra}
actions={actions} actions={actions}
style={{ marginTop: 48, marginBottom: 16 }} style={{ marginTop: 48, marginBottom: 16 }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment