diff --git a/src/components/GlobalHeader/RightContent.js b/src/components/GlobalHeader/RightContent.js
index 12d69516f53facd3676fcf0efb35b26826624575..5272a986f9107c3187084b0e2881de662c06b102 100644
--- a/src/components/GlobalHeader/RightContent.js
+++ b/src/components/GlobalHeader/RightContent.js
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
-import { FormattedMessage, setLocale, getLocale } from 'umi/locale';
+import { FormattedMessage, formatMessage, setLocale, getLocale } from 'umi/locale';
import { Spin, Tag, Menu, Icon, Dropdown, Avatar, Tooltip, Button } from 'antd';
import moment from 'moment';
import groupBy from 'lodash/groupBy';
@@ -87,7 +87,7 @@ export default class GlobalHeaderRight extends PureComponent {
{
console.log('input', value); // eslint-disable-line
@@ -96,13 +96,13 @@ export default class GlobalHeaderRight extends PureComponent {
console.log('enter', value); // eslint-disable-line
}}
/>
-
+
@@ -120,20 +120,20 @@ export default class GlobalHeaderRight extends PureComponent {
>
diff --git a/src/components/NoticeIcon/NoticeList.js b/src/components/NoticeIcon/NoticeList.js
index 7dc17868b9bdefc4ad6e1de7b2a406b99dfc1c75..d0de9af5ef16f3f6cff34da035a4f60e672dc09d 100644
--- a/src/components/NoticeIcon/NoticeList.js
+++ b/src/components/NoticeIcon/NoticeList.js
@@ -63,8 +63,7 @@ export default function NoticeList({
{showClear ? (
- {locale.clear}
- {title}
+ {locale.clear} {title}
) : null}
diff --git a/src/components/NoticeIcon/index.js b/src/components/NoticeIcon/index.js
index 6d3017f33cd7b124e6faaa5ea9f8de76bb8ae01f..af627e679d0c351c69d99909a640c61bdd36d22e 100644
--- a/src/components/NoticeIcon/index.js
+++ b/src/components/NoticeIcon/index.js
@@ -1,4 +1,5 @@
import React, { PureComponent } from 'react';
+import { formatMessage } from 'umi/locale';
import { Popover, Icon, Tabs, Badge, Spin } from 'antd';
import classNames from 'classnames';
import List from './NoticeList';
@@ -16,8 +17,8 @@ export default class NoticeIcon extends PureComponent {
onClear: () => {},
loading: false,
locale: {
- emptyText: '暂无数据',
- clear: '清空',
+ emptyText: formatMessage({ id: 'component.noticeIcon.empty' }),
+ clear: formatMessage({ id: 'component.noticeIcon.clear' }),
},
emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
};
diff --git a/src/layouts/Header.js b/src/layouts/Header.js
index 8ad15c18ab0b3fb4784b90bc2e92b0a1be545ab2..ab004ad91617c77c9a14d5ffeb804e6a628b02fc 100644
--- a/src/layouts/Header.js
+++ b/src/layouts/Header.js
@@ -1,4 +1,5 @@
import React, { PureComponent } from 'react';
+import { formatMessage } from 'umi/locale';
import { Layout, message } from 'antd';
import Animate from 'rc-animate';
import { connect } from 'dva';
@@ -42,7 +43,7 @@ class HeaderView extends PureComponent {
};
handleNoticeClear = type => {
- message.success(`清空了${type}`);
+ message.success(`${formatMessage({ id: 'component.noticeIcon.cleared' })} ${type}`);
const { dispatch } = this.props;
dispatch({
type: 'global/clearNotices',
diff --git a/src/locales/en-US.js b/src/locales/en-US.js
index 85f280dedf30464fd23fb1b11746e261db05c938..dcce3c694cdaca3d6dc1e835554d292c0bcc6170 100644
--- a/src/locales/en-US.js
+++ b/src/locales/en-US.js
@@ -1,5 +1,16 @@
export default {
'navbar.lang': '中文',
+ 'component.globalHeader.search': 'Search',
+ 'component.globalHeader.help': 'Help',
+ 'component.globalHeader.notification': 'Notification',
+ 'component.globalHeader.notification.empty': 'You have viewed all notifications.',
+ 'component.globalHeader.message': 'Message',
+ 'component.globalHeader.message.empty': 'You have viewed all messsages.',
+ 'component.globalHeader.event': 'Event',
+ 'component.globalHeader.event.empty': 'You have viewed all events.',
+ 'component.noticeIcon.clear': 'Clear',
+ 'component.noticeIcon.cleared': 'Cleared',
+ 'component.noticeIcon.empty': 'No notifications',
'menu.home': 'Home',
'menu.dashboard': 'Dashboard',
'menu.dashboard.analysis': 'Analysis',
diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js
index 7c6f363243f035d995c24dd171d3ed15ba7621c5..4e80660796b924d890b54237652562d68f75f765 100644
--- a/src/locales/zh-CN.js
+++ b/src/locales/zh-CN.js
@@ -2,6 +2,17 @@
export default {
'navbar.lang': 'English',
+ 'component.globalHeader.search': '站内搜索',
+ 'component.globalHeader.help': '使用文档',
+ 'component.globalHeader.notification': '通知',
+ 'component.globalHeader.notification.empty': '你已查看所有通知',
+ 'component.globalHeader.message': '消息"',
+ 'component.globalHeader.message.empty': '您已读完所有消息"',
+ 'component.globalHeader.event': '待办',
+ 'component.globalHeader.event.empty': '你已完成所有待办',
+ 'component.noticeIcon.clear': '清空',
+ 'component.noticeIcon.cleared': '清空了',
+ 'component.noticeIcon.empty': '暂无数据',
'menu.home': '首页',
'menu.dashboard': 'Dashboard',
'menu.dashboard.analysis': '分析页',