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