Skip to content

Commit

Permalink
[ISSUE #12246] 配置列表和服务列表的总数显示国际化 (#12276)
Browse files Browse the repository at this point in the history
  • Loading branch information
misakacoder authored Jun 24, 2024
1 parent 27da090 commit 29c28bd
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
10 changes: 7 additions & 3 deletions console-ui/src/components/Page/TotalRender.js
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 2 additions & 0 deletions console-ui/src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions console-ui/src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const I18N_CONF = {
promptDelete: '确定要删除当前服务吗?',
create: '创建服务',
subscriber: '订阅者',
total: '总数:',
},
SubscriberList: {
subscriberList: '订阅者列表',
Expand Down Expand Up @@ -365,6 +366,7 @@ const I18N_CONF = {
cloneEditableTitle: '修改 Data Id 和 Group (可选操作)',
authFail: '权限认证失败',
copyNamespaceID: '复制命名空间ID',
total: '总数:',
},
NewConfig: {
newListingMain: '新建配置',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())}
/>
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
6 changes: 3 additions & 3 deletions console/src/main/resources/static/js/main.js

Large diffs are not rendered by default.

0 comments on commit 29c28bd

Please sign in to comment.