feat: update workspace translation

This commit is contained in:
lleohao
2024-09-03 02:49:27 +00:00
parent 7299b63934
commit 055f45a483
11 changed files with 60 additions and 70 deletions

View File

@ -0,0 +1 @@
{}

View File

@ -47,28 +47,7 @@
"Updated successfully": "Updated successfully",
"Failed to update data": "Failed to update data"
},
"member": {
"Members": "Members",
"Invite members": "Invite members",
"Invite new members": "Invite new members",
"Pending": "Pending",
"User": "User",
"Status": "Status",
"Role": "Role",
"Active": "Active",
"Email": "Email",
"Date": "Date",
"Invited members who are yet to accept their invitation will appear here.": "Invited members who are yet to accept their invitation will appear here.",
"Invite by email": "Invite by email",
"Enter valid email addresses separated by comma or space max_50": "Enter valid email addresses separated by comma or space [max: 50]",
"enter valid emails addresses": "enter valid emails addresses",
"Select role": "Select role",
"Select role to assign to all invited members": "Select role to assign to all invited members",
"Choose a role": "Choose a role",
"Add to groups": "Add to groups",
"Invited members will be granted access to spaces the groups can access": "Invited members will be granted access to spaces the groups can access",
"Send invitation": "Send invitation"
},
"member": {},
"group": {
"Groups": "Groups",
"Create group": "Create group",

View File

@ -1 +1,22 @@
{}
{
"Members": "Members",
"Invite members": "Invite members",
"Invite new members": "Invite new members",
"Pending": "Pending",
"User": "User",
"Status": "Status",
"Role": "Role",
"Active": "Active",
"Email": "Email",
"Date": "Date",
"Invited members who are yet to accept their invitation will appear here.": "Invited members who are yet to accept their invitation will appear here.",
"Invite by email": "Invite by email",
"Enter valid email addresses separated by comma or space max_50": "Enter valid email addresses separated by comma or space [max: 50]",
"enter valid emails addresses": "enter valid emails addresses",
"Select role": "Select role",
"Select role to assign to all invited members": "Select role to assign to all invited members",
"Choose a role": "Choose a role",
"Add to groups": "Add to groups",
"Invited members will be granted access to spaces the groups can access": "Invited members will be granted access to spaces the groups can access",
"Send invitation": "Send invitation"
}

View File

@ -0,0 +1 @@
{}

View File

@ -47,28 +47,7 @@
"Updated successfully": "更新成功",
"Failed to update data": "数据更新失败"
},
"member": {
"Members": "成员",
"Invite members": "邀请成员",
"Invite new members": "邀请新成员",
"Pending": "待定",
"User": "用户",
"Status": "状态",
"Role": "角色",
"Active": "活跃",
"Email": "电子邮箱",
"Date": "日期",
"Invited members who are yet to accept their invitation will appear here.": "尚未接受邀请的成员将显示在这里。",
"Invite by email": "通过电子邮箱邀请",
"Enter valid email addresses separated by comma or space max_50": "输入有效的电子邮箱地址,用逗号或空格分隔 [最多50个]",
"enter valid emails addresses": "输入有效的电子邮箱地址",
"Select role": "选择角色",
"Select role to assign to all invited members": "选择要分配给所有被邀请成员的角色",
"Choose a role": "选择一个角色",
"Add to groups": "添加到群组",
"Invited members will be granted access to spaces the groups can access": "被邀请的成员将被授予访问群组可以访问的空间的权限",
"Send invitation": "发送邀请"
},
"member": {},
"group": {
"Groups": "群组",
"Create group": "创建群组",

View File

@ -1,3 +1,22 @@
{
"space": {}
"Members": "成员",
"Invite members": "邀请成员",
"Invite new members": "邀请新成员",
"Pending": "待定",
"User": "用户",
"Status": "状态",
"Role": "角色",
"Active": "活跃",
"Email": "电子邮箱",
"Date": "日期",
"Invited members who are yet to accept their invitation will appear here.": "尚未接受邀请的成员将显示在这里。",
"Invite by email": "通过电子邮箱邀请",
"Enter valid email addresses separated by comma or space max_50": "输入有效的电子邮箱地址,用逗号或空格分隔 [最多50个]",
"enter valid emails addresses": "输入有效的电子邮箱地址",
"Select role": "选择角色",
"Select role to assign to all invited members": "选择要分配给所有被邀请成员的角色",
"Choose a role": "选择一个角色",
"Add to groups": "添加到群组",
"Invited members will be granted access to spaces the groups can access": "被邀请的成员将被授予访问群组可以访问的空间的权限",
"Send invitation": "发送邀请"
}

View File

@ -11,7 +11,7 @@ interface Props {
onClose: () => void;
}
export function WorkspaceInviteForm({ onClose }: Props) {
const { t } = useTranslation(["settings", "translation"]);
const { t } = useTranslation(["workspace", "translation"]);
const [emails, setEmails] = useState<string[]>([]);
const [role, setRole] = useState<string | null>(UserRole.MEMBER);
const [groupIds, setGroupIds] = useState<string[]>([]);
@ -47,10 +47,10 @@ export function WorkspaceInviteForm({ onClose }: Props) {
<TagsInput
mt="sm"
description={t(
"workspace.member.Enter valid email addresses separated by comma or space max_50",
"Enter valid email addresses separated by comma or space max_50",
)}
label={t("workspace.member.Invite by email")}
placeholder={t("workspace.member.enter valid emails addresses")}
label={t("Invite by email")}
placeholder={t("enter valid emails addresses")}
variant="filled"
splitChars={[",", " "]}
maxDropdownHeight={200}
@ -60,11 +60,9 @@ export function WorkspaceInviteForm({ onClose }: Props) {
<Select
mt="sm"
description={t(
"workspace.member.Select role to assign to all invited members",
)}
label={t("workspace.member.Select role")}
placeholder={t("workspace.member.Choose a role")}
description={t("Select role to assign to all invited members")}
label={t("Select role")}
placeholder={t("Choose a role")}
variant="filled"
data={userRoleData
.filter((role) => role.value !== UserRole.OWNER)
@ -82,9 +80,9 @@ export function WorkspaceInviteForm({ onClose }: Props) {
<MultiGroupSelect
mt="sm"
description={t(
"workspace.member.Invited members will be granted access to spaces the groups can access",
"Invited members will be granted access to spaces the groups can access",
)}
label={t("workspace.member.Add to groups")}
label={t("Add to groups")}
onChange={handleGroupSelect}
/>
@ -93,7 +91,7 @@ export function WorkspaceInviteForm({ onClose }: Props) {
onClick={handleSubmit}
loading={createInvitationMutation.isPending}
>
{t("workspace.member.Send invitation")}
{t("Send invitation")}
</Button>
</Group>
</Box>

View File

@ -4,9 +4,7 @@ import { useDisclosure } from "@mantine/hooks";
import { useTranslation } from "react-i18next";
export default function WorkspaceInviteModal() {
const { t } = useTranslation("settings", {
keyPrefix: "workspace.member",
});
const { t } = useTranslation("workspace");
const [opened, { open, close }] = useDisclosure(false);
return (

View File

@ -9,9 +9,7 @@ import useUserRole from "@/hooks/use-user-role.tsx";
import { useTranslation } from "react-i18next";
export default function WorkspaceInvitesTable() {
const { t } = useTranslation("settings", {
keyPrefix: "workspace.member",
});
const { t } = useTranslation("workspace");
const { data, isLoading } = useWorkspaceInvitationsQuery({
limit: 100,
});

View File

@ -15,9 +15,7 @@ import { UserRole } from "@/lib/types.ts";
import { useTranslation } from "react-i18next";
export default function WorkspaceMembersTable() {
const { t } = useTranslation("settings", {
keyPrefix: "workspace.member",
});
const { t } = useTranslation("workspace");
const { data, isLoading } = useWorkspaceMembersQuery({ limit: 100 });
const changeMemberRoleMutation = useChangeMemberRoleMutation();
const { isAdmin, isOwner } = useUserRole();

View File

@ -9,9 +9,7 @@ import useUserRole from "@/hooks/use-user-role.tsx";
import { useTranslation } from "react-i18next";
export default function WorkspaceMembers() {
const { t } = useTranslation("settings", {
keyPrefix: "workspace.member",
});
const { t } = useTranslation("workspace");
const [segmentValue, setSegmentValue] = useState("members");
const [searchParams] = useSearchParams();
const { isAdmin } = useUserRole();