mirror of
https://github.com/docmost/docmost.git
synced 2025-11-17 00:01:09 +10:00
feat: complete space translation
This commit is contained in:
@ -103,39 +103,6 @@
|
||||
"Search for groups": "Search for groups",
|
||||
"No group found": "No group found"
|
||||
},
|
||||
"space": {
|
||||
"Spaces": "Spaces",
|
||||
"Create space": "Create space",
|
||||
"Space": "Space",
|
||||
"Members": "Members",
|
||||
"Settings": "Settings",
|
||||
"Details": "Details",
|
||||
"Name": "Name",
|
||||
"e.g Sales": "e.g Sales",
|
||||
"Slug": "Slug",
|
||||
"Description": "Description",
|
||||
"e.g Space for sales team to collaborate": "e.g Space for sales team to collaborate",
|
||||
"Save": "Save",
|
||||
"Space name": "Space name",
|
||||
"e.g Product Team": "e.g Product Team",
|
||||
"Space slug": "Space slug",
|
||||
"e.g product": "e.g product",
|
||||
"Space description": "Space description",
|
||||
"e.g Space for product team": "e.g Space for product team",
|
||||
"Create": "Create",
|
||||
"addSpaceMembers": "addSpaceMembers",
|
||||
"add": "add",
|
||||
"selectRole": "selectRole",
|
||||
"Remove space member": "Remove space member",
|
||||
"Are you sure you want to remove this user from the space? The user will lose all access to this space.": "Are you sure you want to remove this user from the space? The user will lose all access to this space.",
|
||||
"Remove": "Remove",
|
||||
"Cancel": "Cancel",
|
||||
"Member": "Member",
|
||||
"Role": "Role",
|
||||
"Failed to load page. An error occurred.": "Failed to load page. An error occurred.",
|
||||
"Add members": "Add members",
|
||||
"Search for users and groups": "Search for users and groups",
|
||||
"No user found": "No user found"
|
||||
}
|
||||
"space": {}
|
||||
}
|
||||
}
|
||||
|
||||
45
apps/client/public/locales/en/space.json
Normal file
45
apps/client/public/locales/en/space.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"Overview": "Overview",
|
||||
"Search": "Search",
|
||||
"Space settings": "Space settings",
|
||||
"New page": "New page",
|
||||
"Pages": "Pages",
|
||||
"Create page": "Create page",
|
||||
"Import pages & space settings": "Import pages & space settings",
|
||||
"Space menu": "Space menu",
|
||||
"Import pages": "Import pages",
|
||||
"Spaces": "Spaces",
|
||||
"Create space": "Create space",
|
||||
"Space": "Space",
|
||||
"Members": "Members",
|
||||
"Settings": "Settings",
|
||||
"Details": "Details",
|
||||
"Name": "Name",
|
||||
"e.g Sales": "e.g Sales",
|
||||
"Slug": "Slug",
|
||||
"Description": "Description",
|
||||
"e.g Space for sales team to collaborate": "e.g Space for sales team to collaborate",
|
||||
"Save": "Save",
|
||||
"Space name": "Space name",
|
||||
"e.g Product Team": "e.g Product Team",
|
||||
"Space slug": "Space slug",
|
||||
"e.g product": "e.g product",
|
||||
"Space description": "Space description",
|
||||
"e.g Space for product team": "e.g Space for product team",
|
||||
"Create": "Create",
|
||||
"addSpaceMembers": "addSpaceMembers",
|
||||
"add": "add",
|
||||
"selectRole": "selectRole",
|
||||
"Remove space member": "Remove space member",
|
||||
"Are you sure you want to remove this user from the space? The user will lose all access to this space.": "Are you sure you want to remove this user from the space? The user will lose all access to this space.",
|
||||
"Remove": "Remove",
|
||||
"Cancel": "Cancel",
|
||||
"Member": "Member",
|
||||
"Role": "Role",
|
||||
"Failed to load page. An error occurred.": "Failed to load page. An error occurred.",
|
||||
"Add members": "Add members",
|
||||
"Search for users and groups": "Search for users and groups",
|
||||
"No user found": "No user found",
|
||||
"Spaces you belong to": "Spaces you belong to",
|
||||
"Recently updated": "Recently updated"
|
||||
}
|
||||
@ -39,10 +39,7 @@
|
||||
"home": {
|
||||
"Recently updated": "Recently updated"
|
||||
},
|
||||
"space": {
|
||||
"Spaces you belong to": "Spaces you belong to",
|
||||
"Recently updated": "Recently updated"
|
||||
},
|
||||
"space": {},
|
||||
"page": {
|
||||
"Error fetching page data.": "Error fetching page data.",
|
||||
"untitled": "untitled",
|
||||
|
||||
1
apps/client/public/locales/en/workspace.json
Normal file
1
apps/client/public/locales/en/workspace.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -103,39 +103,6 @@
|
||||
"Search for groups": "搜索群组",
|
||||
"No group found": "未找到群组"
|
||||
},
|
||||
"space": {
|
||||
"Spaces": "空间",
|
||||
"Create space": "创建空间",
|
||||
"Space": "空间",
|
||||
"Members": "成员",
|
||||
"Settings": "设置",
|
||||
"Details": "详情",
|
||||
"Name": "名称",
|
||||
"e.g Sales": "例如:销售",
|
||||
"Slug": "短链接",
|
||||
"Description": "描述",
|
||||
"e.g Space for sales team to collaborate": "例如:销售团队协作的空间",
|
||||
"Save": "保存",
|
||||
"Space name": "空间名称",
|
||||
"e.g Product Team": "例如:产品团队",
|
||||
"Space slug": "空间短链接",
|
||||
"e.g product": "例如:product",
|
||||
"Space description": "空间描述",
|
||||
"e.g Space for product team": "例如:产品团队的空间",
|
||||
"Create": "创建",
|
||||
"addSpaceMembers": "添加空间成员",
|
||||
"add": "添加",
|
||||
"selectRole": "选择角色",
|
||||
"Remove space member": "移除空间成员",
|
||||
"Are you sure you want to remove this user from the space? The user will lose all access to this space.": "您确定要从空间中移除这个用户吗?该用户将失去对这个空间的所有访问权限。",
|
||||
"Remove": "移除",
|
||||
"Cancel": "取消",
|
||||
"Member": "成员",
|
||||
"Role": "角色",
|
||||
"Failed to load page. An error occurred.": "页面加载失败。发生了一个错误。",
|
||||
"Add members": "添加成员",
|
||||
"Search for users and groups": "搜索用户和群组",
|
||||
"No user found": "未找到用户"
|
||||
}
|
||||
"space": {}
|
||||
}
|
||||
}
|
||||
|
||||
45
apps/client/public/locales/zh/space.json
Normal file
45
apps/client/public/locales/zh/space.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"Overview": "概览",
|
||||
"Search": "搜索",
|
||||
"Space settings": "空间设置",
|
||||
"New page": "新建页面",
|
||||
"Pages": "页面",
|
||||
"Create page": "创建页面",
|
||||
"Import pages & space settings": "导入页面和空间设置",
|
||||
"Space menu": "空间菜单",
|
||||
"Import pages": "导入页面",
|
||||
"Spaces": "空间",
|
||||
"Create space": "创建空间",
|
||||
"Space": "空间",
|
||||
"Members": "成员",
|
||||
"Settings": "设置",
|
||||
"Details": "详情",
|
||||
"Name": "名称",
|
||||
"e.g Sales": "例如:销售",
|
||||
"Slug": "短链接",
|
||||
"Description": "描述",
|
||||
"e.g Space for sales team to collaborate": "例如:销售团队协作的空间",
|
||||
"Save": "保存",
|
||||
"Space name": "空间名称",
|
||||
"e.g Product Team": "例如:产品团队",
|
||||
"Space slug": "空间短链接",
|
||||
"e.g product": "例如:product",
|
||||
"Space description": "空间描述",
|
||||
"e.g Space for product team": "例如:产品团队的空间",
|
||||
"Create": "创建",
|
||||
"addSpaceMembers": "添加空间成员",
|
||||
"add": "添加",
|
||||
"selectRole": "选择角色",
|
||||
"Remove space member": "移除空间成员",
|
||||
"Are you sure you want to remove this user from the space? The user will lose all access to this space.": "您确定要从空间中移除这个用户吗?该用户将失去对这个空间的所有访问权限。",
|
||||
"Remove": "移除",
|
||||
"Cancel": "取消",
|
||||
"Member": "成员",
|
||||
"Role": "角色",
|
||||
"Failed to load page. An error occurred.": "页面加载失败。发生了一个错误。",
|
||||
"Add members": "添加成员",
|
||||
"Search for users and groups": "搜索用户和群组",
|
||||
"No user found": "未找到用户",
|
||||
"Spaces you belong to": "您所属的空间",
|
||||
"Recently updated": "最近更新"
|
||||
}
|
||||
@ -39,10 +39,7 @@
|
||||
"home": {
|
||||
"Recently updated": "最近更新"
|
||||
},
|
||||
"space": {
|
||||
"Spaces you belong to": "您所属的空间",
|
||||
"Recently updated": "最近更新"
|
||||
},
|
||||
"space": {},
|
||||
"page": {
|
||||
"Error fetching page data.": "获取页面数据时出错。",
|
||||
"untitled": "无标题",
|
||||
|
||||
3
apps/client/public/locales/zh/workspace.json
Normal file
3
apps/client/public/locales/zh/workspace.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"space": {}
|
||||
}
|
||||
@ -13,9 +13,7 @@ interface AddSpaceMemberModalProps {
|
||||
export default function AddSpaceMembersModal({
|
||||
spaceId,
|
||||
}: AddSpaceMemberModalProps) {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [memberIds, setMemberIds] = useState<string[]>([]);
|
||||
const [role, setRole] = useState<string>(SpaceRole.WRITER);
|
||||
|
||||
@ -23,9 +23,7 @@ const formSchema = z.object({
|
||||
type FormValues = z.infer<typeof formSchema>;
|
||||
|
||||
export function CreateSpaceForm() {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const createSpaceMutation = useCreateSpaceMutation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
||||
@ -4,9 +4,7 @@ import { CreateSpaceForm } from "@/features/space/components/create-space-form.t
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function CreateSpaceModal() {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
return (
|
||||
|
||||
@ -17,9 +17,7 @@ interface EditSpaceFormProps {
|
||||
readOnly?: boolean;
|
||||
}
|
||||
export function EditSpaceForm({ space, readOnly }: EditSpaceFormProps) {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const updateSpaceMutation = useUpdateSpaceMutation();
|
||||
|
||||
const form = useForm<FormValues>({
|
||||
|
||||
@ -31,9 +31,7 @@ const renderMultiSelectOption: MultiSelectProps["renderOption"] = ({
|
||||
);
|
||||
|
||||
export function MultiMemberSelect({ onChange }: MultiMemberSelectProps) {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const [searchValue, setSearchValue] = useState("");
|
||||
const [debouncedQuery] = useDebouncedValue(searchValue, 500);
|
||||
const { data: suggestion, isLoading } = useSearchSuggestionsQuery({
|
||||
|
||||
@ -22,9 +22,7 @@ export default function SpaceSettingsModal({
|
||||
opened,
|
||||
onClose,
|
||||
}: SpaceSettingsModalProps) {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const { data: space, isLoading } = useSpaceQuery(spaceId);
|
||||
|
||||
const spaceRules = space?.membership?.permissions;
|
||||
|
||||
@ -35,8 +35,10 @@ import {
|
||||
SpaceCaslSubject,
|
||||
} from "@/features/space/permissions/permissions.type.ts";
|
||||
import PageImportModal from "@/features/page/components/page-import-modal.tsx";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function SpaceSidebar() {
|
||||
const { t } = useTranslation("space");
|
||||
const [tree] = useAtom(treeApiAtom);
|
||||
const location = useLocation();
|
||||
const [opened, { open: openSettings, close: closeSettings }] =
|
||||
@ -86,7 +88,7 @@ export function SpaceSidebar() {
|
||||
className={classes.menuItemIcon}
|
||||
stroke={2}
|
||||
/>
|
||||
<span>Overview</span>
|
||||
<span>{t("Overview")}</span>
|
||||
</div>
|
||||
</UnstyledButton>
|
||||
|
||||
@ -97,7 +99,7 @@ export function SpaceSidebar() {
|
||||
className={classes.menuItemIcon}
|
||||
stroke={2}
|
||||
/>
|
||||
<span>Search</span>
|
||||
<span>{t("Search")}</span>
|
||||
</div>
|
||||
</UnstyledButton>
|
||||
|
||||
@ -108,7 +110,7 @@ export function SpaceSidebar() {
|
||||
className={classes.menuItemIcon}
|
||||
stroke={2}
|
||||
/>
|
||||
<span>Space settings</span>
|
||||
<span>{t("Space settings")}</span>
|
||||
</div>
|
||||
</UnstyledButton>
|
||||
|
||||
@ -126,7 +128,7 @@ export function SpaceSidebar() {
|
||||
className={classes.menuItemIcon}
|
||||
stroke={2}
|
||||
/>
|
||||
<span>New page</span>
|
||||
<span>{t("New page")}</span>
|
||||
</div>
|
||||
</UnstyledButton>
|
||||
)}
|
||||
@ -136,7 +138,7 @@ export function SpaceSidebar() {
|
||||
<div className={classes.section}>
|
||||
<Group className={classes.pagesHeader} justify="space-between">
|
||||
<Text size="xs" fw={500} c="dimmed">
|
||||
Pages
|
||||
{t("Pages")}
|
||||
</Text>
|
||||
|
||||
{spaceAbility.can(
|
||||
@ -146,12 +148,12 @@ export function SpaceSidebar() {
|
||||
<Group gap="xs">
|
||||
<SpaceMenu spaceId={space.id} onSpaceSettings={openSettings} />
|
||||
|
||||
<Tooltip label="Create page" withArrow position="right">
|
||||
<Tooltip label={t("Create page")} withArrow position="right">
|
||||
<ActionIcon
|
||||
variant="default"
|
||||
size={18}
|
||||
onClick={handleCreatePage}
|
||||
aria-label="Create page"
|
||||
aria-label={t("Create page")}
|
||||
>
|
||||
<IconPlus />
|
||||
</ActionIcon>
|
||||
@ -188,6 +190,7 @@ interface SpaceMenuProps {
|
||||
onSpaceSettings: () => void;
|
||||
}
|
||||
function SpaceMenu({ spaceId, onSpaceSettings }: SpaceMenuProps) {
|
||||
const { t } = useTranslation("space");
|
||||
const [importOpened, { open: openImportModal, close: closeImportModal }] =
|
||||
useDisclosure(false);
|
||||
|
||||
@ -196,11 +199,15 @@ function SpaceMenu({ spaceId, onSpaceSettings }: SpaceMenuProps) {
|
||||
<Menu width={200} shadow="md" withArrow>
|
||||
<Menu.Target>
|
||||
<Tooltip
|
||||
label="Import pages & space settings"
|
||||
label={t("Import pages & space settings")}
|
||||
withArrow
|
||||
position="top"
|
||||
>
|
||||
<ActionIcon variant="default" size={18} aria-label="Space menu">
|
||||
<ActionIcon
|
||||
variant="default"
|
||||
size={18}
|
||||
aria-label={t("Space menu")}
|
||||
>
|
||||
<IconDots />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
@ -211,7 +218,7 @@ function SpaceMenu({ spaceId, onSpaceSettings }: SpaceMenuProps) {
|
||||
onClick={openImportModal}
|
||||
leftSection={<IconArrowDown size={16} />}
|
||||
>
|
||||
Import pages
|
||||
{t("Import pages")}
|
||||
</Menu.Item>
|
||||
|
||||
<Menu.Divider />
|
||||
@ -220,7 +227,7 @@ function SpaceMenu({ spaceId, onSpaceSettings }: SpaceMenuProps) {
|
||||
onClick={onSpaceSettings}
|
||||
leftSection={<IconSettings size={16} />}
|
||||
>
|
||||
Space settings
|
||||
{t("Space settings")}
|
||||
</Menu.Item>
|
||||
</Menu.Dropdown>
|
||||
</Menu>
|
||||
|
||||
@ -9,9 +9,7 @@ interface SpaceDetailsProps {
|
||||
readOnly?: boolean;
|
||||
}
|
||||
export default function SpaceDetails({ spaceId, readOnly }: SpaceDetailsProps) {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const { data: space, isLoading } = useSpaceQuery(spaceId);
|
||||
|
||||
return (
|
||||
|
||||
@ -8,8 +8,7 @@ import { formatMemberCount } from "@/lib";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function SpaceGrid() {
|
||||
const { t } = useTranslation("translation", { keyPrefix: "space" });
|
||||
|
||||
const { t } = useTranslation("space");
|
||||
const { data, isLoading } = useGetSpacesQuery();
|
||||
|
||||
const cards = data?.items.map((space, index) => (
|
||||
|
||||
@ -6,9 +6,7 @@ import { useGetSpaceBySlugQuery } from "@/features/space/queries/space-query.ts"
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function SpaceHomeTabs() {
|
||||
const { t } = useTranslation("translaction", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const { spaceSlug } = useParams();
|
||||
const { data: space } = useGetSpaceBySlugQuery(spaceSlug);
|
||||
|
||||
|
||||
@ -7,9 +7,7 @@ import { formatMemberCount } from "@/lib";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function SpaceList() {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const { data, isLoading } = useGetSpacesQuery();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [selectedSpaceId, setSelectedSpaceId] = useState<string>(null);
|
||||
|
||||
@ -27,9 +27,7 @@ export default function SpaceMembersList({
|
||||
spaceId,
|
||||
readOnly,
|
||||
}: SpaceMembersProps) {
|
||||
const { t } = useTranslation("settings", {
|
||||
keyPrefix: "workspace.space",
|
||||
});
|
||||
const { t } = useTranslation("space");
|
||||
const { data, isLoading } = useSpaceMembersQuery(spaceId);
|
||||
const removeSpaceMember = useRemoveSpaceMemberMutation();
|
||||
const changeSpaceMemberRoleMutation = useChangeSpaceMemberRoleMutation();
|
||||
|
||||
Reference in New Issue
Block a user