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

@ -201,7 +201,7 @@ class ApplicationEditPage extends React.Component {
</Col>
<Col span={22} >
<UrlTable
title="Redirect URLs"
title={i18next.t("application:Redirect URLs")}
table={this.state.application.redirectUris}
onUpdateTable={(value) => { this.updateApplicationField('redirectUris', value)}}
/>

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>
)}
/>

View File

@ -1,6 +1,5 @@
import React from "react";
import {Cascader, Col, Input, Row, Select} from 'antd';
import * as Setting from "../Setting";
import i18next from "i18next";
import * as UserBackend from "../backend/UserBackend";

View File

@ -11,6 +11,8 @@
"Action": "Action",
"Edit": "Edit",
"Delete": "Delete",
"Up": "Up",
"Down": "Down",
"Organization": "Organization",
"Created time": "Created time",
"Name": "Name",
@ -174,7 +176,9 @@
"Enable password": "Enable password",
"Login page preview": "Login page preview",
"Test signup page..": "Test signup page..",
"Test signin page..": "Test signin page.."
"Test signin page..": "Test signin page..",
"Redirect URL": "Redirect URL",
"Redirect URLs": "Redirect URLs"
},
"forget":
{

View File

@ -8,9 +8,11 @@
"Applications": "应用",
"Save": "保存",
"Add": "添加",
"Action": "行为",
"Action": "操作",
"Edit": "修改",
"Delete": "删除",
"Up": "上移",
"Down": "下移",
"Organization": "组织",
"Created time": "创建时间",
"Name": "名称",
@ -174,7 +176,9 @@
"Enable password": "开启密码",
"Login page preview": "登录页面预览",
"Test signup page..": "测试注册页面..",
"Test signin page..": "测试登录页面.."
"Test signin page..": "测试登录页面..",
"Redirect URL": "回调URL",
"Redirect URLs": "回调URLs"
},
"forget":
{