[ISSUE #12246] 配置列表和服务列表的总数显示国际化 (#12276)

This commit is contained in:
misakacoder 2024-06-24 13:49:43 +08:00 committed by GitHub
parent 27da090b7c
commit 29c28bd01e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 18 additions and 10 deletions

View File

@ -1,8 +1,12 @@
import React from 'react';
const TotalRender = ({ total, range }) => {
// const [start, end] = range;
return <span>总数 : {total}</span>;
const TotalRender = ({ locale, total }) => {
return (
<span style={{ display: `inline-block`, marginLeft: 16, fontSize: 14, color: '#999999' }}>
{locale.total}
{total}
</span>
);
};
export default TotalRender;

View File

@ -129,6 +129,7 @@ const I18N_CONF = {
promptDelete: 'Do you want to delete the service?',
create: 'Create Service',
subscriber: 'Subscriber',
total: 'Total:',
},
SubscriberList: {
subscriberList: 'Subscriber List',
@ -369,6 +370,7 @@ const I18N_CONF = {
cloneEditableTitle: 'Modify Data Id and Group (optional)',
authFail: 'Auth failed',
copyNamespaceID: 'Copy namespace ID',
total: 'Total:',
},
NewConfig: {
newListingMain: 'Create Configuration',

View File

@ -127,6 +127,7 @@ const I18N_CONF = {
promptDelete: '确定要删除当前服务吗',
create: '创建服务',
subscriber: '订阅者',
total: '总数',
},
SubscriberList: {
subscriberList: '订阅者列表',
@ -365,6 +366,7 @@ const I18N_CONF = {
cloneEditableTitle: '修改 Data Id Group (可选操作)',
authFail: '权限认证失败',
copyNamespaceID: '复制命名空间ID',
total: '总数',
},
NewConfig: {
newListingMain: '新建配置',

View File

@ -1406,7 +1406,7 @@ class ConfigurationManagement extends React.Component {
onPageSizeChange={val => this.handlePageSizeChange(val)}
current={configurations.pageNumber}
total={configurations.totalCount}
totalRender={(total, range) => <TotalRender total={total} range={range} />}
totalRender={total => <TotalRender locale={locale} total={total} />}
pageSize={this.state.pageSize}
onChange={this.changePage.bind(this)}
/>

View File

@ -344,7 +344,7 @@ class ServiceList extends React.Component {
popupProps={{ align: 'bl tl' }}
total={this.state.total}
pageSize={this.state.pageSize}
totalRender={(total, range) => <TotalRender total={total} range={range} />}
totalRender={total => <TotalRender locale={locale} total={total} />}
onPageSizeChange={pageSize => this.handlePageSizeChange(pageSize)}
onChange={currentPage => this.setState({ currentPage }, () => this.queryServiceList())}
/>

View File

@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?dfa5340ca3e297239923" rel="stylesheet"></head>
<link href="./css/main.css?50300f41fe7e73539edb" rel="stylesheet"></head>
<body>
<div id="root" style="overflow:hidden"></div>
@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?dfa5340ca3e297239923"></script></body>
<script type="text/javascript" src="./js/main.js?50300f41fe7e73539edb"></script></body>
</html>

File diff suppressed because one or more lines are too long