From ac4dfc124b8b082f530b0a82a10b6e63001c38ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A7=80=E7=8E=B2?= Date: Thu, 12 Jul 2018 14:01:50 +0800 Subject: [PATCH] translate exception pages --- src/locales/en-US.js | 4 ++++ src/locales/zh-CN.js | 4 ++++ src/pages/Exception/403.js | 20 ++++++++++++++++---- src/pages/Exception/404.js | 20 ++++++++++++++++---- src/pages/Exception/500.js | 20 ++++++++++++++++---- 5 files changed, 56 insertions(+), 12 deletions(-) diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 6540955a..89284b54 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -121,4 +121,8 @@ export default { 'The to-do list will be notified in the form of a letter from the station', 'app.settings.open': 'Open', 'app.settings.close': 'Close', + 'app.exception.back': 'Back to home', + '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', }; diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index 84d7b5e0..09b67be8 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -117,4 +117,8 @@ export default { 'app.settings.notification.todo-description': '账户密码', 'app.settings.open': '开', 'app.settings.close': '关', + 'app.exception.back': '返回首页', + 'app.exception.description.403': '抱歉,你无权访问该页面', + 'app.exception.description.404': '抱歉,你访问的页面不存在', + 'app.exception.description.500': '抱歉,服务器出错了', }; diff --git a/src/pages/Exception/403.js b/src/pages/Exception/403.js index c6d86fe0..15681eea 100644 --- a/src/pages/Exception/403.js +++ b/src/pages/Exception/403.js @@ -1,7 +1,19 @@ -import React from 'react'; +import React, { Component } from 'react'; +import { injectIntl } from 'react-intl'; import { Link } from 'dva/router'; import Exception from 'components/Exception'; -export default () => ( - -); +class Exception403 extends Component { + render() { + const { intl } = this.props; + return ( + + ); + } +} +export default injectIntl(Exception403); diff --git a/src/pages/Exception/404.js b/src/pages/Exception/404.js index 0a3d8766..62be537e 100644 --- a/src/pages/Exception/404.js +++ b/src/pages/Exception/404.js @@ -1,7 +1,19 @@ -import React from 'react'; +import React, { Component } from 'react'; +import { injectIntl } from 'react-intl'; import { Link } from 'dva/router'; import Exception from 'components/Exception'; -export default () => ( - -); +class Exception404 extends Component { + render() { + const { intl } = this.props; + return ( + + ); + } +} +export default injectIntl(Exception404); diff --git a/src/pages/Exception/500.js b/src/pages/Exception/500.js index 40f659cb..f4227a99 100644 --- a/src/pages/Exception/500.js +++ b/src/pages/Exception/500.js @@ -1,7 +1,19 @@ -import React from 'react'; +import React, { Component } from 'react'; +import { injectIntl } from 'react-intl'; import { Link } from 'dva/router'; import Exception from 'components/Exception'; -export default () => ( - -); +class Exception500 extends Component { + render() { + const { intl } = this.props; + return ( + + ); + } +} +export default injectIntl(Exception500); -- GitLab