mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
Improve i18n for permission page
This commit is contained in:
@ -245,7 +245,8 @@ class PermissionEditPage extends React.Component {
|
|||||||
})}>
|
})}>
|
||||||
{
|
{
|
||||||
[
|
[
|
||||||
{id: "Application", name: "Application"},
|
{id: "Application", name: i18next.t("general:Application")},
|
||||||
|
{id: "TreeNode", name: i18next.t("permission:TreeNode")},
|
||||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
@ -273,9 +274,9 @@ class PermissionEditPage extends React.Component {
|
|||||||
})}>
|
})}>
|
||||||
{
|
{
|
||||||
[
|
[
|
||||||
{id: "Read", name: "Read"},
|
{id: "Read", name: i18next.t("permission:Read")},
|
||||||
{id: "Write", name: "Write"},
|
{id: "Write", name: i18next.t("permission:Write")},
|
||||||
{id: "Admin", name: "Admin"},
|
{id: "Admin", name: i18next.t("permission:Admin")},
|
||||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
@ -291,8 +292,8 @@ class PermissionEditPage extends React.Component {
|
|||||||
})}>
|
})}>
|
||||||
{
|
{
|
||||||
[
|
[
|
||||||
{id: "Allow", name: "Allow"},
|
{id: "Allow", name: i18next.t("permission:Allow")},
|
||||||
{id: "Deny", name: "Deny"},
|
{id: "Deny", name: i18next.t("permission:Deny")},
|
||||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
@ -358,8 +359,8 @@ class PermissionEditPage extends React.Component {
|
|||||||
})}>
|
})}>
|
||||||
{
|
{
|
||||||
[
|
[
|
||||||
{id: "Approved", name: "Approved"},
|
{id: "Approved", name: i18next.t("permission:Approved")},
|
||||||
{id: "Pending", name: "Pending"},
|
{id: "Pending", name: i18next.t("permission:Pending")},
|
||||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
|
@ -188,7 +188,19 @@ class PermissionListPage extends BaseListPage {
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
...this.getColumnSearchProps("actions"),
|
...this.getColumnSearchProps("actions"),
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return Setting.getTags(text);
|
const tags = text.map((tag, i) => {
|
||||||
|
switch (tag) {
|
||||||
|
case "Read":
|
||||||
|
return i18next.t("permission:Read");
|
||||||
|
case "Write":
|
||||||
|
return i18next.t("permission:Write");
|
||||||
|
case "Admin":
|
||||||
|
return i18next.t("permission:Admin");
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Setting.getTags(tags);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -197,11 +209,21 @@ class PermissionListPage extends BaseListPage {
|
|||||||
key: "effect",
|
key: "effect",
|
||||||
filterMultiple: false,
|
filterMultiple: false,
|
||||||
filters: [
|
filters: [
|
||||||
{text: "Allow", value: "Allow"},
|
{text: i18next.t("permission:Allow"), value: "Allow"},
|
||||||
{text: "Deny", value: "Deny"},
|
{text: i18next.t("permission:Deny"), value: "Deny"},
|
||||||
],
|
],
|
||||||
width: "120px",
|
width: "120px",
|
||||||
sorter: true,
|
sorter: true,
|
||||||
|
render: (text, record, index) => {
|
||||||
|
switch (text) {
|
||||||
|
case "Allow":
|
||||||
|
return Setting.getTag("success", i18next.t("permission:Allow"));
|
||||||
|
case "Deny":
|
||||||
|
return Setting.getTag("error", i18next.t("permission:Deny"));
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: i18next.t("general:Is enabled"),
|
title: i18next.t("general:Is enabled"),
|
||||||
@ -248,11 +270,21 @@ class PermissionListPage extends BaseListPage {
|
|||||||
key: "state",
|
key: "state",
|
||||||
filterMultiple: false,
|
filterMultiple: false,
|
||||||
filters: [
|
filters: [
|
||||||
{text: "Approved", value: "Approved"},
|
{text: i18next.t("permission:Approved"), value: "Approved"},
|
||||||
{text: "Pending", value: "Pending"},
|
{text: i18next.t("permission:Pending"), value: "Pending"},
|
||||||
],
|
],
|
||||||
width: "120px",
|
width: "120px",
|
||||||
sorter: true,
|
sorter: true,
|
||||||
|
render: (text, record, index) => {
|
||||||
|
switch (text) {
|
||||||
|
case "Approved":
|
||||||
|
return Setting.getTag("success", i18next.t("permission:Approved"));
|
||||||
|
case "Pending":
|
||||||
|
return Setting.getTag("error", i18next.t("permission:Pending"));
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: i18next.t("general:Action"),
|
title: i18next.t("general:Action"),
|
||||||
|
@ -857,7 +857,10 @@ export function getTagColor(s) {
|
|||||||
|
|
||||||
export function getTags(tags) {
|
export function getTags(tags) {
|
||||||
const res = [];
|
const res = [];
|
||||||
if (!tags) {return res;}
|
if (!tags) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
tags.forEach((tag, i) => {
|
tags.forEach((tag, i) => {
|
||||||
res.push(
|
res.push(
|
||||||
<Tag color={getTagColor(tag)}>
|
<Tag color={getTagColor(tag)}>
|
||||||
@ -868,6 +871,14 @@ export function getTags(tags) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getTag(color, text) {
|
||||||
|
return (
|
||||||
|
<Tag color={color}>
|
||||||
|
{text}
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function getApplicationOrgName(application) {
|
export function getApplicationOrgName(application) {
|
||||||
return `${application?.organizationObj.owner}/${application?.organizationObj.name}`;
|
return `${application?.organizationObj.owner}/${application?.organizationObj.name}`;
|
||||||
}
|
}
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "Aktionen",
|
"Actions": "Aktionen",
|
||||||
"Actions - Tooltip": "Aktionen - Tooltip",
|
"Actions - Tooltip": "Aktionen - Tooltip",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Allow": "Allow",
|
||||||
"Approve time": "Approve time",
|
"Approve time": "Approve time",
|
||||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||||
|
"Approved": "Approved",
|
||||||
"Approver": "Approver",
|
"Approver": "Approver",
|
||||||
"Approver - Tooltip": "Approver - Tooltip",
|
"Approver - Tooltip": "Approver - Tooltip",
|
||||||
|
"Deny": "Deny",
|
||||||
"Edit Permission": "Berechtigung bearbeiten",
|
"Edit Permission": "Berechtigung bearbeiten",
|
||||||
"Effect": "Effekt",
|
"Effect": "Effekt",
|
||||||
"Effect - Tooltip": "Effekt - Tooltip",
|
"Effect - Tooltip": "Effekt - Tooltip",
|
||||||
"New Permission": "New Permission",
|
"New Permission": "New Permission",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Read": "Read",
|
||||||
"Resource type": "Ressourcentyp",
|
"Resource type": "Ressourcentyp",
|
||||||
"Resource type - Tooltip": "Ressourcentyp - Tooltip",
|
"Resource type - Tooltip": "Ressourcentyp - Tooltip",
|
||||||
"Resources": "Ressourcen",
|
"Resources": "Ressourcen",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "State",
|
"State": "State",
|
||||||
"State - Tooltip": "State - Tooltip",
|
"State - Tooltip": "State - Tooltip",
|
||||||
"Submitter": "Submitter",
|
"Submitter": "Submitter",
|
||||||
"Submitter - Tooltip": "Submitter - Tooltip"
|
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||||
|
"TreeNode": "TreeNode",
|
||||||
|
"Write": "Write"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "Alipay",
|
"Alipay": "Alipay",
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "Actions",
|
"Actions": "Actions",
|
||||||
"Actions - Tooltip": "Actions - Tooltip",
|
"Actions - Tooltip": "Actions - Tooltip",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Allow": "Allow",
|
||||||
"Approve time": "Approve time",
|
"Approve time": "Approve time",
|
||||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||||
|
"Approved": "Approved",
|
||||||
"Approver": "Approver",
|
"Approver": "Approver",
|
||||||
"Approver - Tooltip": "Approver - Tooltip",
|
"Approver - Tooltip": "Approver - Tooltip",
|
||||||
|
"Deny": "Deny",
|
||||||
"Edit Permission": "Edit Permission",
|
"Edit Permission": "Edit Permission",
|
||||||
"Effect": "Effect",
|
"Effect": "Effect",
|
||||||
"Effect - Tooltip": "Effect - Tooltip",
|
"Effect - Tooltip": "Effect - Tooltip",
|
||||||
"New Permission": "New Permission",
|
"New Permission": "New Permission",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Read": "Read",
|
||||||
"Resource type": "Resource type",
|
"Resource type": "Resource type",
|
||||||
"Resource type - Tooltip": "Resource type - Tooltip",
|
"Resource type - Tooltip": "Resource type - Tooltip",
|
||||||
"Resources": "Resources",
|
"Resources": "Resources",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "State",
|
"State": "State",
|
||||||
"State - Tooltip": "State - Tooltip",
|
"State - Tooltip": "State - Tooltip",
|
||||||
"Submitter": "Submitter",
|
"Submitter": "Submitter",
|
||||||
"Submitter - Tooltip": "Submitter - Tooltip"
|
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||||
|
"TreeNode": "TreeNode",
|
||||||
|
"Write": "Write"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "Alipay",
|
"Alipay": "Alipay",
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "Actions",
|
"Actions": "Actions",
|
||||||
"Actions - Tooltip": "Actions - Info-bulle",
|
"Actions - Tooltip": "Actions - Info-bulle",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Allow": "Allow",
|
||||||
"Approve time": "Approve time",
|
"Approve time": "Approve time",
|
||||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||||
|
"Approved": "Approved",
|
||||||
"Approver": "Approver",
|
"Approver": "Approver",
|
||||||
"Approver - Tooltip": "Approver - Tooltip",
|
"Approver - Tooltip": "Approver - Tooltip",
|
||||||
|
"Deny": "Deny",
|
||||||
"Edit Permission": "Autorisation d'édition",
|
"Edit Permission": "Autorisation d'édition",
|
||||||
"Effect": "Effet",
|
"Effect": "Effet",
|
||||||
"Effect - Tooltip": "Effet - Infobulle",
|
"Effect - Tooltip": "Effet - Infobulle",
|
||||||
"New Permission": "New Permission",
|
"New Permission": "New Permission",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Read": "Read",
|
||||||
"Resource type": "Type de ressource",
|
"Resource type": "Type de ressource",
|
||||||
"Resource type - Tooltip": "Type de ressource - infobulle",
|
"Resource type - Tooltip": "Type de ressource - infobulle",
|
||||||
"Resources": "Ressource",
|
"Resources": "Ressource",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "State",
|
"State": "State",
|
||||||
"State - Tooltip": "State - Tooltip",
|
"State - Tooltip": "State - Tooltip",
|
||||||
"Submitter": "Submitter",
|
"Submitter": "Submitter",
|
||||||
"Submitter - Tooltip": "Submitter - Tooltip"
|
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||||
|
"TreeNode": "TreeNode",
|
||||||
|
"Write": "Write"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "Alipay",
|
"Alipay": "Alipay",
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "アクション",
|
"Actions": "アクション",
|
||||||
"Actions - Tooltip": "アクション → ツールチップ",
|
"Actions - Tooltip": "アクション → ツールチップ",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Allow": "Allow",
|
||||||
"Approve time": "Approve time",
|
"Approve time": "Approve time",
|
||||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||||
|
"Approved": "Approved",
|
||||||
"Approver": "Approver",
|
"Approver": "Approver",
|
||||||
"Approver - Tooltip": "Approver - Tooltip",
|
"Approver - Tooltip": "Approver - Tooltip",
|
||||||
|
"Deny": "Deny",
|
||||||
"Edit Permission": "権限を編集",
|
"Edit Permission": "権限を編集",
|
||||||
"Effect": "効果",
|
"Effect": "効果",
|
||||||
"Effect - Tooltip": "エフェクト - ツールチップ",
|
"Effect - Tooltip": "エフェクト - ツールチップ",
|
||||||
"New Permission": "New Permission",
|
"New Permission": "New Permission",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Read": "Read",
|
||||||
"Resource type": "リソースタイプ",
|
"Resource type": "リソースタイプ",
|
||||||
"Resource type - Tooltip": "リソースタイプ - ツールチップ",
|
"Resource type - Tooltip": "リソースタイプ - ツールチップ",
|
||||||
"Resources": "リソース",
|
"Resources": "リソース",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "State",
|
"State": "State",
|
||||||
"State - Tooltip": "State - Tooltip",
|
"State - Tooltip": "State - Tooltip",
|
||||||
"Submitter": "Submitter",
|
"Submitter": "Submitter",
|
||||||
"Submitter - Tooltip": "Submitter - Tooltip"
|
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||||
|
"TreeNode": "TreeNode",
|
||||||
|
"Write": "Write"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "Alipay",
|
"Alipay": "Alipay",
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "Actions",
|
"Actions": "Actions",
|
||||||
"Actions - Tooltip": "Actions - Tooltip",
|
"Actions - Tooltip": "Actions - Tooltip",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Allow": "Allow",
|
||||||
"Approve time": "Approve time",
|
"Approve time": "Approve time",
|
||||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||||
|
"Approved": "Approved",
|
||||||
"Approver": "Approver",
|
"Approver": "Approver",
|
||||||
"Approver - Tooltip": "Approver - Tooltip",
|
"Approver - Tooltip": "Approver - Tooltip",
|
||||||
|
"Deny": "Deny",
|
||||||
"Edit Permission": "Edit Permission",
|
"Edit Permission": "Edit Permission",
|
||||||
"Effect": "Effect",
|
"Effect": "Effect",
|
||||||
"Effect - Tooltip": "Effect - Tooltip",
|
"Effect - Tooltip": "Effect - Tooltip",
|
||||||
"New Permission": "New Permission",
|
"New Permission": "New Permission",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Read": "Read",
|
||||||
"Resource type": "Resource type",
|
"Resource type": "Resource type",
|
||||||
"Resource type - Tooltip": "Resource type - Tooltip",
|
"Resource type - Tooltip": "Resource type - Tooltip",
|
||||||
"Resources": "Resources",
|
"Resources": "Resources",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "State",
|
"State": "State",
|
||||||
"State - Tooltip": "State - Tooltip",
|
"State - Tooltip": "State - Tooltip",
|
||||||
"Submitter": "Submitter",
|
"Submitter": "Submitter",
|
||||||
"Submitter - Tooltip": "Submitter - Tooltip"
|
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||||
|
"TreeNode": "TreeNode",
|
||||||
|
"Write": "Write"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "Alipay",
|
"Alipay": "Alipay",
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "Действия",
|
"Actions": "Действия",
|
||||||
"Actions - Tooltip": "Действия - Подсказка",
|
"Actions - Tooltip": "Действия - Подсказка",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Allow": "Allow",
|
||||||
"Approve time": "Approve time",
|
"Approve time": "Approve time",
|
||||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||||
|
"Approved": "Approved",
|
||||||
"Approver": "Approver",
|
"Approver": "Approver",
|
||||||
"Approver - Tooltip": "Approver - Tooltip",
|
"Approver - Tooltip": "Approver - Tooltip",
|
||||||
|
"Deny": "Deny",
|
||||||
"Edit Permission": "Изменить права доступа",
|
"Edit Permission": "Изменить права доступа",
|
||||||
"Effect": "Эффект",
|
"Effect": "Эффект",
|
||||||
"Effect - Tooltip": "Эффект - Подсказка",
|
"Effect - Tooltip": "Эффект - Подсказка",
|
||||||
"New Permission": "New Permission",
|
"New Permission": "New Permission",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Read": "Read",
|
||||||
"Resource type": "Тип ресурса",
|
"Resource type": "Тип ресурса",
|
||||||
"Resource type - Tooltip": "Тип ресурса - Подсказка",
|
"Resource type - Tooltip": "Тип ресурса - Подсказка",
|
||||||
"Resources": "Ресурсы",
|
"Resources": "Ресурсы",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "State",
|
"State": "State",
|
||||||
"State - Tooltip": "State - Tooltip",
|
"State - Tooltip": "State - Tooltip",
|
||||||
"Submitter": "Submitter",
|
"Submitter": "Submitter",
|
||||||
"Submitter - Tooltip": "Submitter - Tooltip"
|
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||||
|
"TreeNode": "TreeNode",
|
||||||
|
"Write": "Write"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "Alipay",
|
"Alipay": "Alipay",
|
||||||
|
@ -346,14 +346,20 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"Actions": "动作",
|
"Actions": "动作",
|
||||||
"Actions - Tooltip": "授权的动作",
|
"Actions - Tooltip": "授权的动作",
|
||||||
|
"Admin": "管理员权限",
|
||||||
|
"Allow": "允许",
|
||||||
"Approve time": "审批时间",
|
"Approve time": "审批时间",
|
||||||
"Approve time - Tooltip": "该授权被审批通过的时间",
|
"Approve time - Tooltip": "该授权被审批通过的时间",
|
||||||
|
"Approved": "审批通过",
|
||||||
"Approver": "审批者",
|
"Approver": "审批者",
|
||||||
"Approver - Tooltip": "审批通过该授权的人",
|
"Approver - Tooltip": "审批通过该授权的人",
|
||||||
|
"Deny": "拒绝",
|
||||||
"Edit Permission": "编辑权限",
|
"Edit Permission": "编辑权限",
|
||||||
"Effect": "效果",
|
"Effect": "效果",
|
||||||
"Effect - Tooltip": "允许还是拒绝",
|
"Effect - Tooltip": "允许还是拒绝",
|
||||||
"New Permission": "添加权限",
|
"New Permission": "添加权限",
|
||||||
|
"Pending": "待审批",
|
||||||
|
"Read": "读权限",
|
||||||
"Resource type": "资源类型",
|
"Resource type": "资源类型",
|
||||||
"Resource type - Tooltip": "授权资源的类型",
|
"Resource type - Tooltip": "授权资源的类型",
|
||||||
"Resources": "资源",
|
"Resources": "资源",
|
||||||
@ -361,7 +367,9 @@
|
|||||||
"State": "审批状态",
|
"State": "审批状态",
|
||||||
"State - Tooltip": "该授权现在的状态",
|
"State - Tooltip": "该授权现在的状态",
|
||||||
"Submitter": "申请者",
|
"Submitter": "申请者",
|
||||||
"Submitter - Tooltip": "申请该授权的人"
|
"Submitter - Tooltip": "申请该授权的人",
|
||||||
|
"TreeNode": "树节点",
|
||||||
|
"Write": "写权限"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"Alipay": "支付宝",
|
"Alipay": "支付宝",
|
||||||
|
Reference in New Issue
Block a user