Improve i18n.

This commit is contained in:
Yang Luo
2021-06-14 17:18:40 +08:00
parent 7f22f05073
commit 2e68f8c6d5
5 changed files with 20 additions and 12 deletions

View File

@ -16,6 +16,7 @@ import React from "react";
import {DownOutlined, DeleteOutlined, UpOutlined, LinkOutlined} from '@ant-design/icons';
import {Button, Col, Input, Row, Table, Tooltip} from 'antd';
import * as Setting from "./Setting";
import i18next from "i18next";
class UrlTable extends React.Component {
constructor(props) {
@ -61,7 +62,7 @@ class UrlTable extends React.Component {
renderTable(table) {
const columns = [
{
title: 'Redirect URLs',
title: i18next.t("application:Redirect URL"),
dataIndex: 'id',
key: 'id',
render: (text, record, index) => {
@ -73,19 +74,19 @@ class UrlTable extends React.Component {
}
},
{
title: 'Action',
title: i18next.t("general:Action"),
key: 'action',
width: '120px',
width: '100px',
render: (text, record, index) => {
return (
<div>
<Tooltip placement="bottomLeft" title="Up">
<Tooltip placement="bottomLeft" title={i18next.t("general:Up")}>
<Button style={{marginRight: "5px"}} disabled={index === 0} icon={<UpOutlined />} size="small" onClick={() => this.upRow(table, index)} />
</Tooltip>
<Tooltip placement="topLeft" title="Down">
<Tooltip placement="topLeft" title={i18next.t("general:Down")}>
<Button style={{marginRight: "5px"}} disabled={index === table.length - 1} icon={<DownOutlined />} size="small" onClick={() => this.downRow(table, index)} />
</Tooltip>
<Tooltip placement="topLeft" title="Delete">
<Tooltip placement="topLeft" title={i18next.t("general:Delete")}>
<Button icon={<DeleteOutlined />} size="small" onClick={() => this.deleteRow(table, index)} />
</Tooltip>
</div>
@ -99,7 +100,7 @@ class UrlTable extends React.Component {
title={() => (
<div>
{this.props.title}&nbsp;&nbsp;&nbsp;&nbsp;
<Button style={{marginRight: "5px"}} type="primary" size="small" onClick={() => this.addRow(table)}>Add</Button>
<Button style={{marginRight: "5px"}} type="primary" size="small" onClick={() => this.addRow(table)}>{i18next.t("general:Add")}</Button>
</div>
)}
/>