From a34317193cece2532ed333aaaacfd3a6af7328c4 Mon Sep 17 00:00:00 2001 From: liuxiran Date: Thu, 31 Dec 2020 00:42:37 +0800 Subject: [PATCH] fix: protable search&reset button i18n (#1153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: protable search&reset button i18n * fix: markdown lint check error * fix: update refer to code review * fix: update refer to the code review * fix: ssl Co-authored-by: litesun Co-authored-by: 琚致远 --- docs/I18N_USER_GUIDE.md | 2 +- web/src/pages/Consumer/List.tsx | 3 --- web/src/pages/Route/List.tsx | 3 --- web/src/pages/SSL/List.tsx | 2 -- web/src/pages/Service/List.tsx | 8 ++++---- web/src/pages/Upstream/List.tsx | 3 --- 6 files changed, 5 insertions(+), 16 deletions(-) diff --git a/docs/I18N_USER_GUIDE.md b/docs/I18N_USER_GUIDE.md index 9e1b991a1d..d05a16a7ef 100644 --- a/docs/I18N_USER_GUIDE.md +++ b/docs/I18N_USER_GUIDE.md @@ -45,7 +45,7 @@ the key can be like this : [basicModule].[moduleName].[elementName].[...desc] ## Global locale keys -we have already defined many global keys, before you do i18n, you can refer to [those](https://github.com/apache/apisix-dashboard/blob/master/src/locales/zh-CN/component.ts). +we have already defined many global keys, before you do i18n, you can refer to [those](https://github.com/apache/apisix-dashboard/blob/master/web/src/locales/zh-CN/component.ts). ## Recommended subkey naming diff --git a/web/src/pages/Consumer/List.tsx b/web/src/pages/Consumer/List.tsx index 6bec2d2860..b1351bb6ba 100644 --- a/web/src/pages/Consumer/List.tsx +++ b/web/src/pages/Consumer/List.tsx @@ -22,13 +22,10 @@ import { history, useIntl } from 'umi'; import { PlusOutlined } from '@ant-design/icons'; import { timestampToLocaleString } from '@/helpers'; -import useForceIntl from '@/hooks/useForceIntl'; import { fetchList, remove } from './service'; const Page: React.FC = () => { - useForceIntl(); - const ref = useRef(); const { formatMessage } = useIntl(); diff --git a/web/src/pages/Route/List.tsx b/web/src/pages/Route/List.tsx index 3ac4019bea..304ad3b179 100644 --- a/web/src/pages/Route/List.tsx +++ b/web/src/pages/Route/List.tsx @@ -22,15 +22,12 @@ import { history, useIntl } from 'umi'; import { PlusOutlined, BugOutlined } from '@ant-design/icons'; import { timestampToLocaleString } from '@/helpers'; -import useForceIntl from '@/hooks/useForceIntl'; import { fetchList, remove, fetchLabelList, updateRouteStatus } from './service'; import { DebugDrawView } from './components/DebugViews'; const { OptGroup, Option } = Select; const Page: React.FC = () => { - useForceIntl(); - const ref = useRef(); const { formatMessage } = useIntl(); diff --git a/web/src/pages/SSL/List.tsx b/web/src/pages/SSL/List.tsx index db02600a0b..c9a7dd5ee2 100644 --- a/web/src/pages/SSL/List.tsx +++ b/web/src/pages/SSL/List.tsx @@ -23,10 +23,8 @@ import { PlusOutlined } from '@ant-design/icons'; import { fetchList, remove as removeSSL } from '@/pages/SSL/service'; import { timestampToLocaleString } from '@/helpers'; -import useForceIntl from '@/hooks/useForceIntl'; const Page: React.FC = () => { - useForceIntl(); const tableRef = useRef(); const { formatMessage } = useIntl(); diff --git a/web/src/pages/Service/List.tsx b/web/src/pages/Service/List.tsx index 4ec8d8536e..f7b747206c 100644 --- a/web/src/pages/Service/List.tsx +++ b/web/src/pages/Service/List.tsx @@ -21,13 +21,9 @@ import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import { PlusOutlined } from '@ant-design/icons'; import { Button, notification, Popconfirm, Space } from 'antd'; -import useForceIntl from '@/hooks/useForceIntl'; - import { fetchList, remove } from './service'; const Page: React.FC = () => { - useForceIntl(); - const ref = useRef(); const { formatMessage } = useIntl(); @@ -96,6 +92,10 @@ const Page: React.FC = () => { rowKey="id" columns={columns} request={fetchList} + search={{ + searchText: formatMessage({ id: 'component.global.search' }), + resetText: formatMessage({ id: 'component.global.reset' }), + }} toolBarRender={() => [