From 1b0760f5af300e43d33e2f0f5e5f5fa2de5ad8dc Mon Sep 17 00:00:00 2001 From: lleohao <12764126+lleohao@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:07:05 +0000 Subject: [PATCH] refactor: merge to single file --- apps/client/public/locales/en/group.json | 34 --- .../public/locales/en/invite-signup.json | 11 - apps/client/public/locales/en/login.json | 7 - apps/client/public/locales/en/page.json | 33 --- apps/client/public/locales/en/search.json | 5 - .../public/locales/en/setup-workspace.json | 11 - apps/client/public/locales/en/space.json | 47 ---- .../client/public/locales/en/translation.json | 227 +++++++++++++++--- apps/client/public/locales/en/user.json | 37 --- apps/client/public/locales/en/workspace.json | 28 --- apps/client/public/locales/zh/group.json | 34 --- .../public/locales/zh/invite-signup.json | 11 - apps/client/public/locales/zh/login.json | 7 - apps/client/public/locales/zh/page.json | 33 --- apps/client/public/locales/zh/search.json | 5 - .../public/locales/zh/setup-workspace.json | 11 - apps/client/public/locales/zh/space.json | 47 ---- .../client/public/locales/zh/translation.json | 227 +++++++++++++++--- apps/client/public/locales/zh/user.json | 37 --- apps/client/public/locales/zh/workspace.json | 28 --- apps/client/src/App.tsx | 4 +- .../src/components/common/recent-changes.tsx | 2 +- .../components/layouts/global/app-header.tsx | 4 +- .../components/layouts/global/top-menu.tsx | 4 +- .../components/settings/settings-sidebar.tsx | 4 +- .../src/components/ui/role-select-menu.tsx | 4 +- .../auth/components/invite-sign-up-form.tsx | 2 +- .../features/auth/components/login-form.tsx | 2 +- .../auth/components/setup-workspace-form.tsx | 2 +- .../components/add-group-member-modal.tsx | 2 +- .../group/components/create-group-form.tsx | 2 +- .../group/components/create-group-modal.tsx | 2 +- .../group/components/edit-group-form.tsx | 2 +- .../group/components/edit-group-modal.tsx | 2 +- .../group/components/group-action-menu.tsx | 2 +- .../features/group/components/group-list.tsx | 2 +- .../group/components/group-members.tsx | 2 +- .../group/components/multi-group-select.tsx | 2 +- .../group/components/multi-user-select.tsx | 2 +- .../features/home/components/home-tabs.tsx | 2 +- .../page-history/components/history-list.tsx | 2 +- .../page-history/components/history-modal.tsx | 2 +- .../page-history/components/history-view.tsx | 2 +- .../components/header/page-header-menu.tsx | 2 +- .../page/components/page-import-modal.tsx | 4 +- .../page/hooks/use-delete-page-modal.tsx | 2 +- .../src/features/page/queries/page-query.ts | 6 +- .../page/tree/components/space-tree.tsx | 2 +- .../src/features/search/search-spotlight.tsx | 2 +- .../components/add-space-members-modal.tsx | 2 +- .../space/components/create-space-form.tsx | 2 +- .../space/components/create-space-modal.tsx | 2 +- .../space/components/edit-space-form.tsx | 2 +- .../space/components/multi-member-select.tsx | 2 +- .../space/components/settings-modal.tsx | 2 +- .../components/sidebar/space-sidebar.tsx | 4 +- .../space/components/space-details.tsx | 2 +- .../features/space/components/space-grid.tsx | 2 +- .../space/components/space-home-tabs.tsx | 2 +- .../features/space/components/space-list.tsx | 2 +- .../space/components/space-members.tsx | 2 +- .../user/components/account-avatar.tsx | 2 +- .../user/components/account-languate.tsx | 4 +- .../user/components/account-name-form.tsx | 2 +- .../user/components/account-theme.tsx | 4 +- .../features/user/components/change-email.tsx | 4 +- .../user/components/change-password.tsx | 4 +- .../user/components/page-width-pref.tsx | 4 +- .../components/workspace-invite-form.tsx | 6 +- .../components/workspace-invite-modal.tsx | 2 +- .../components/workspace-invites-table.tsx | 2 +- .../components/workspace-members-table.tsx | 2 +- .../components/workspace-name-form.tsx | 2 +- apps/client/src/pages/auth/invite-signup.tsx | 2 +- apps/client/src/pages/auth/login.tsx | 2 +- .../client/src/pages/auth/setup-workspace.tsx | 2 +- apps/client/src/pages/page/page.tsx | 2 +- .../settings/account/account-preferences.tsx | 2 +- .../settings/account/account-settings.tsx | 2 +- .../src/pages/settings/group/group-info.tsx | 2 +- .../src/pages/settings/group/groups.tsx | 2 +- .../src/pages/settings/space/spaces.tsx | 2 +- .../settings/workspace/workspace-members.tsx | 2 +- .../settings/workspace/workspace-settings.tsx | 2 +- package.json | 3 + 85 files changed, 452 insertions(+), 591 deletions(-) delete mode 100644 apps/client/public/locales/en/group.json delete mode 100644 apps/client/public/locales/en/invite-signup.json delete mode 100644 apps/client/public/locales/en/login.json delete mode 100644 apps/client/public/locales/en/page.json delete mode 100644 apps/client/public/locales/en/search.json delete mode 100644 apps/client/public/locales/en/setup-workspace.json delete mode 100644 apps/client/public/locales/en/space.json delete mode 100644 apps/client/public/locales/en/user.json delete mode 100644 apps/client/public/locales/en/workspace.json delete mode 100644 apps/client/public/locales/zh/group.json delete mode 100644 apps/client/public/locales/zh/invite-signup.json delete mode 100644 apps/client/public/locales/zh/login.json delete mode 100644 apps/client/public/locales/zh/page.json delete mode 100644 apps/client/public/locales/zh/search.json delete mode 100644 apps/client/public/locales/zh/setup-workspace.json delete mode 100644 apps/client/public/locales/zh/space.json delete mode 100644 apps/client/public/locales/zh/user.json delete mode 100644 apps/client/public/locales/zh/workspace.json diff --git a/apps/client/public/locales/en/group.json b/apps/client/public/locales/en/group.json deleted file mode 100644 index 5f7ce567..00000000 --- a/apps/client/public/locales/en/group.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Groups": "Groups", - "Create group": "Create group", - "Group": "Group", - "Members": "Members", - "member": "member", - "members": "members", - "Manage Group": "Manage Group", - "addGroupMembers": "addGroupMembers", - "add": "add", - "Edit group": "Edit group", - "Group name": "Group name", - "e.g Developers": "e.g Developers", - "Group description": "Group description", - "e.g Group for developers": "e.g Group for developers", - "Edit": "Edit", - "Delete group": "Delete group", - "Are you sure you want to delete this group? Members will lose access to resources this group has access to.": "Are you sure you want to delete this group? Members will lose access to resources this group has access to.", - "Delete": "Delete", - "Cancel": "Cancel", - "Remove group member": "Remove group member", - "Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.": "Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.", - "Add group members": "Add group members", - "Create": "Create", - "User": "User", - "Status": "Status", - "Active": "Active", - "Add members": "Add members", - "Search for users": "Search for users", - "No user found": "No user found", - "Add groups": "Add groups", - "Search for groups": "Search for groups", - "No group found": "No group found" -} diff --git a/apps/client/public/locales/en/invite-signup.json b/apps/client/public/locales/en/invite-signup.json deleted file mode 100644 index 921066ec..00000000 --- a/apps/client/public/locales/en/invite-signup.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Join the workspace": "Join the workspace", - "Name": "Name", - "enter your full name": "enter your full name", - "Email": "Email", - "Password": "Password", - "Your password": "Your password", - "Sign Up": "Sign Up", - "invalid invitation link": "invalid invitation link", - "Invitation signup": "Invitation signup" -} diff --git a/apps/client/public/locales/en/login.json b/apps/client/public/locales/en/login.json deleted file mode 100644 index d5e6319f..00000000 --- a/apps/client/public/locales/en/login.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Login": "Login", - "Email": "Email", - "Password": "Password", - "Your password": "Your password", - "Sign In": "Sign In" -} diff --git a/apps/client/public/locales/en/page.json b/apps/client/public/locales/en/page.json deleted file mode 100644 index 96d8f126..00000000 --- a/apps/client/public/locales/en/page.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Copy link": "Copy link", - "Delete": "Delete", - "Link copied": "Link copied", - "Are you sure you want to delete this page?": "Are you sure you want to delete this page?", - "Cancel": "Cancel", - "deletePageModalContent": "Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.", - "Page deleted successfully": "Page deleted successfully", - "Failed to delete page": "Failed to delete page", - "Failed to create page": "Failed to create page", - "Import pages": "Import pages", - "Importing pages": "Importing pages", - "Page import is in progress. Please do not close this tab.": "Page import is in progress. Please do not close this tab.", - "Successfully imported": "Successfully imported", - "Your import is complete.": "Your import is complete.", - "Failed to import pages": "Failed to import pages", - "Unable to import pages. Please try again.": "Unable to import pages. Please try again.", - "page": "page", - "pages": "pages", - "Error fetching page data.": "Error fetching page data.", - "untitled": "untitled", - "Full width": "Full width", - "Page history": "Page history", - "Export": "Export", - "Print PDF": "Print PDF", - "Error loading page history.": "Error loading page history.", - "No page history saved yet.": "No page history saved yet.", - "Please confirm your action": "Please confirm your action", - "Are you sure you want to restore this version? Any changes not versioned will be lost.": "Are you sure you want to restore this version? Any changes not versioned will be lost.", - "Confirm": "Confirm", - "Successfully restored": "Successfully restored", - "Restore": "Restore" -} diff --git a/apps/client/public/locales/en/search.json b/apps/client/public/locales/en/search.json deleted file mode 100644 index d06882a8..00000000 --- a/apps/client/public/locales/en/search.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Search...": "Search...", - "Start typing to search...": "Start typing to search...", - "No results found...": "No results found..." -} diff --git a/apps/client/public/locales/en/setup-workspace.json b/apps/client/public/locales/en/setup-workspace.json deleted file mode 100644 index b1d15e48..00000000 --- a/apps/client/public/locales/en/setup-workspace.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Setup workspace": "Setup workspace", - "Create workspace": "Create workspace", - "Workspace Name": "Workspace Name", - "e.g ACME Inc": "e.g ACME Inc", - "Your Name": "Your Name", - "enter your full name": "enter your full name", - "Your Email": "Your Email", - "Password": "Password", - "Enter a strong password": "Enter a strong password" -} diff --git a/apps/client/public/locales/en/space.json b/apps/client/public/locales/en/space.json deleted file mode 100644 index 3151a782..00000000 --- a/apps/client/public/locales/en/space.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "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", - "member": "member", - "members": "members" -} diff --git a/apps/client/public/locales/en/translation.json b/apps/client/public/locales/en/translation.json index f6fcd395..b59b6eb2 100644 --- a/apps/client/public/locales/en/translation.json +++ b/apps/client/public/locales/en/translation.json @@ -1,42 +1,189 @@ { - "common": { - "Failed to fetch recent pages": "Failed to fetch recent pages", - "Untitled": "Untitled", - "No pages yet": "No pages yet", - "Failed to load page. An error occurred.": "Failed to load page. An error occurred." - }, - "role": { - "Full access": "Full access", - "Has full access to space settings and pages.": "Has full access to space settings and pages.", - "Can edit": "Can edit", - "Can create and edit pages in space.": "Can create and edit pages in space.", - "Can view": "Can view", - "Can view pages in space but not edit.": "Can view pages in space but not edit.", - "Owner": "Owner", - "Can manage workspace": "Can manage workspace", - "Admin": "Admin", - "Can manage workspace but cannot delete it": "Can manage workspace but cannot delete it", - "Member": "Member", - "Can become members of groups and spaces in workspace": "Can become members of groups and spaces in workspace" - }, - "layout": { - "Home": "Home", - "Workspace": "Workspace", - "Workspace settings": "Workspace settings", - "Manage members": "Manage members", - "Account": "Account", - "My profile": "My profile", - "My preferences": "My preferences", - "Logout": "Logout", - "Settings": "Settings", - "Profile": "Profile", - "Preferences": "Preferences", - "General": "General", - "Members": "Members", - "Groups": "Groups", - "Spaces": "Spaces" - }, - "home": { - "Recently updated": "Recently updated" - } + "Account": "Account", + "Active": "Active", + "add": "add", + "Add group members": "Add group members", + "Add groups": "Add groups", + "Add members": "Add members", + "Add to groups": "Add to groups", + "addGroupMembers": "addGroupMembers", + "addSpaceMembers": "addSpaceMembers", + "Admin": "Admin", + "Are you sure you want to delete this group? Members will lose access to resources this group has access to.": "Are you sure you want to delete this group? Members will lose access to resources this group has access to.", + "Are you sure you want to delete this page?": "Are you sure you want to delete this page?", + "Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.": "Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.", + "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.", + "Are you sure you want to restore this version? Any changes not versioned will be lost.": "Are you sure you want to restore this version? Any changes not versioned will be lost.", + "Can become members of groups and spaces in workspace": "Can become members of groups and spaces in workspace", + "Can create and edit pages in space.": "Can create and edit pages in space.", + "Can edit": "Can edit", + "Can manage workspace": "Can manage workspace", + "Can manage workspace but cannot delete it": "Can manage workspace but cannot delete it", + "Can view": "Can view", + "Can view pages in space but not edit.": "Can view pages in space but not edit.", + "Cancel": "Cancel", + "Change email": "Change email", + "Change password": "Change password", + "Change photo": "Change photo", + "Choose a role": "Choose a role", + "Choose your preferred color scheme.": "Choose your preferred color scheme.", + "Choose your preferred interface language.": "Choose your preferred interface language.", + "Choose your preferred page width.": "Choose your preferred page width.", + "Confirm": "Confirm", + "Copy link": "Copy link", + "Create": "Create", + "Create group": "Create group", + "Create page": "Create page", + "Create space": "Create space", + "Create workspace": "Create workspace", + "Current password": "Current password", + "Dark": "Dark", + "Date": "Date", + "Delete": "Delete", + "Delete group": "Delete group", + "deletePageModalContent": "Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.", + "Description": "Description", + "Details": "Details", + "e.g ACME": "e.g ACME", + "e.g ACME Inc": "e.g ACME Inc", + "e.g Developers": "e.g Developers", + "e.g Group for developers": "e.g Group for developers", + "e.g product": "e.g product", + "e.g Product Team": "e.g Product Team", + "e.g Sales": "e.g Sales", + "e.g Space for product team": "e.g Space for product team", + "e.g Space for sales team to collaborate": "e.g Space for sales team to collaborate", + "Edit": "Edit", + "Edit group": "Edit group", + "Email": "Email", + "Enter a strong password": "Enter a strong password", + "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", + "Enter your current password": "Enter your current password", + "enter your full name": "enter your full name", + "Enter your new password": "Enter your new password", + "Enter your new preferred email": "Enter your new preferred email", + "Enter your password": "Enter your password", + "Error fetching page data.": "Error fetching page data.", + "Error loading page history.": "Error loading page history.", + "Export": "Export", + "Failed to create page": "Failed to create page", + "Failed to delete page": "Failed to delete page", + "Failed to fetch recent pages": "Failed to fetch recent pages", + "Failed to import pages": "Failed to import pages", + "Failed to load page. An error occurred.": "Failed to load page. An error occurred.", + "Failed to update data": "Failed to update data", + "Full access": "Full access", + "Full page width": "Full page width", + "Full width": "Full width", + "General": "General", + "Group": "Group", + "Group description": "Group description", + "Group name": "Group name", + "Groups": "Groups", + "Has full access to space settings and pages.": "Has full access to space settings and pages.", + "Home": "Home", + "Import pages": "Import pages", + "Import pages & space settings": "Import pages & space settings", + "Importing pages": "Importing pages", + "invalid invitation link": "invalid invitation link", + "Invitation signup": "Invitation signup", + "Invite by email": "Invite by email", + "Invite members": "Invite members", + "Invite new members": "Invite new members", + "Invited members who are yet to accept their invitation will appear here.": "Invited members who are yet to accept their invitation will appear here.", + "Invited members will be granted access to spaces the groups can access": "Invited members will be granted access to spaces the groups can access", + "Join the workspace": "Join the workspace", + "Language": "Language", + "Light": "Light", + "Link copied": "Link copied", + "Login": "Login", + "Logout": "Logout", + "Manage Group": "Manage Group", + "Manage members": "Manage members", + "member": "member", + "Member": "Member", + "members": "members", + "Members": "Members", + "My preferences": "My preferences", + "My Profile": "My Profile", + "My profile": "My profile", + "Name": "Name", + "New email": "New email", + "New page": "New page", + "New password": "New password", + "No group found": "No group found", + "No page history saved yet.": "No page history saved yet.", + "No pages yet": "No pages yet", + "No results found...": "No results found...", + "No user found": "No user found", + "Overview": "Overview", + "Owner": "Owner", + "page": "page", + "Page deleted successfully": "Page deleted successfully", + "Page history": "Page history", + "Page import is in progress. Please do not close this tab.": "Page import is in progress. Please do not close this tab.", + "Pages": "Pages", + "pages": "pages", + "Password": "Password", + "Password changed successfully": "Password changed successfully", + "Pending": "Pending", + "Please confirm your action": "Please confirm your action", + "Preferences": "Preferences", + "Print PDF": "Print PDF", + "Profile": "Profile", + "Recently updated": "Recently updated", + "Remove": "Remove", + "Remove group member": "Remove group member", + "Remove space member": "Remove space member", + "Restore": "Restore", + "Role": "Role", + "Save": "Save", + "Search": "Search", + "Search for groups": "Search for groups", + "Search for users": "Search for users", + "Search for users and groups": "Search for users and groups", + "Search...": "Search...", + "Select language": "Select language", + "Select role": "Select role", + "Select role to assign to all invited members": "Select role to assign to all invited members", + "Select theme": "Select theme", + "selectRole": "selectRole", + "Send invitation": "Send invitation", + "Settings": "Settings", + "Setup workspace": "Setup workspace", + "Sign In": "Sign In", + "Sign Up": "Sign Up", + "Slug": "Slug", + "Space": "Space", + "Space description": "Space description", + "Space menu": "Space menu", + "Space name": "Space name", + "Space settings": "Space settings", + "Space slug": "Space slug", + "Spaces": "Spaces", + "Spaces you belong to": "Spaces you belong to", + "Start typing to search...": "Start typing to search...", + "Status": "Status", + "Successfully imported": "Successfully imported", + "Successfully restored": "Successfully restored", + "System settings": "System settings", + "Theme": "Theme", + "To change your email, you have to enter your password and new email.": "To change your email, you have to enter your password and new email.", + "Toggle full page width": "Toggle full page width", + "Unable to import pages. Please try again.": "Unable to import pages. Please try again.", + "untitled": "untitled", + "Untitled": "Untitled", + "Updated successfully": "Updated successfully", + "User": "User", + "Workspace": "Workspace", + "Workspace Name": "Workspace Name", + "Workspace settings": "Workspace settings", + "You can change your password here.": "You can change your password here.", + "Your Email": "Your Email", + "Your import is complete.": "Your import is complete.", + "Your name": "Your name", + "Your Name": "Your Name", + "Your password": "Your password", + "Your password must be a minimum of 8 characters.": "Your password must be a minimum of 8 characters." } diff --git a/apps/client/public/locales/en/user.json b/apps/client/public/locales/en/user.json deleted file mode 100644 index f976f75f..00000000 --- a/apps/client/public/locales/en/user.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "My Profile": "My Profile", - "Change photo": "Change photo", - "Name": "Name", - "Your name": "Your name", - "Save": "Save", - "Updated successfully": "Updated successfully", - "Failed to update data": "Failed to update data", - "Email": "Email", - "Change email": "Change email", - "To change your email, you have to enter your password and new email.": "To change your email, you have to enter your password and new email.", - "Password": "Password", - "Enter your password": "Enter your password", - "Enter your new preferred email": "Enter your new preferred email", - "New email": "New email", - "You can change your password here.": "You can change your password here.", - "Change password": "Change password", - "Your password must be a minimum of 8 characters.": "Your password must be a minimum of 8 characters.", - "Current password": "Current password", - "Enter your current password": "Enter your current password", - "New password": "New password", - "Enter your new password": "Enter your new password", - "Password changed successfully": "Password changed successfully", - "Preferences": "Preferences", - "Theme": "Theme", - "Choose your preferred color scheme.": "Choose your preferred color scheme.", - "Select theme": "Select theme", - "Light": "Light", - "Dark": "Dark", - "System settings": "System settings", - "Language": "Language", - "Choose your preferred interface language.": "Choose your preferred interface language.", - "Select language": "Select language", - "Full page width": "Full page width", - "Choose your preferred page width.": "Choose your preferred page width.", - "Toggle full page width": "Toggle full page width" -} diff --git a/apps/client/public/locales/en/workspace.json b/apps/client/public/locales/en/workspace.json deleted file mode 100644 index 5dd7050e..00000000 --- a/apps/client/public/locales/en/workspace.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "General": "General", - "Name": "Name", - "e.g ACME": "e.g ACME", - "Save": "Save", - "Updated successfully": "Updated successfully", - "Failed to update data": "Failed to update data", - "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" -} diff --git a/apps/client/public/locales/zh/group.json b/apps/client/public/locales/zh/group.json deleted file mode 100644 index 456c9e03..00000000 --- a/apps/client/public/locales/zh/group.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Groups": "群组", - "Create group": "创建群组", - "Group": "群组", - "Members": "成员", - "member": "个成员", - "members": "个成员", - "Manage Group": "管理群组", - "addGroupMembers": "添加群组成员", - "add": "添加", - "Edit group": "编辑群组", - "Group name": "群组名称", - "e.g Developers": "例如:开发人员", - "Group description": "群组描述", - "e.g Group for developers": "例如:开发人员群组", - "Edit": "编辑", - "Delete group": "删除群组", - "Are you sure you want to delete this group? Members will lose access to resources this group has access to.": "您确定要删除这个群组吗?成员将失去对该群组可访问资源的访问权限。", - "Delete": "删除", - "Cancel": "取消", - "Remove group member": "移除群组成员", - "Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.": "您确定要从群组中移除这个用户吗?该用户将失去对该群组可访问资源的访问权限。", - "Add group members": "添加群组成员", - "Create": "创建", - "User": "用户", - "Status": "状态", - "Active": "活跃", - "Add members": "添加成员", - "Search for users": "搜索用户", - "No user found": "未找到用户", - "Add groups": "添加群组", - "Search for groups": "搜索群组", - "No group found": "未找到群组" -} diff --git a/apps/client/public/locales/zh/invite-signup.json b/apps/client/public/locales/zh/invite-signup.json deleted file mode 100644 index 42af9a04..00000000 --- a/apps/client/public/locales/zh/invite-signup.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Join the workspace": "加入工作空间", - "Name": "姓名", - "enter your full name": "输入您的全名", - "Email": "电子邮箱", - "Password": "密码", - "Your password": "您的密码", - "Sign Up": "注册", - "invalid invitation link": "无效的邀请链接", - "Invitation signup": "邀请注册" -} diff --git a/apps/client/public/locales/zh/login.json b/apps/client/public/locales/zh/login.json deleted file mode 100644 index 3d17499a..00000000 --- a/apps/client/public/locales/zh/login.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Login": "登录", - "Email": "电子邮箱", - "Password": "密码", - "Your password": "您的密码", - "Sign In": "登录" -} diff --git a/apps/client/public/locales/zh/page.json b/apps/client/public/locales/zh/page.json deleted file mode 100644 index 5d7dbc00..00000000 --- a/apps/client/public/locales/zh/page.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Copy link": "复制链接", - "Delete": "删除", - "Link copied": "链接已复制", - "Are you sure you want to delete this page?": "您确定要删除这个页面吗?", - "Cancel": "取消", - "deletePageModalContent": "您确定要删除这个页面吗?这将删除其子页面和页面历史记录。此操作不可逆。", - "Page deleted successfully": "页面已成功删除", - "Failed to delete page": "删除页面失败", - "Failed to create page": "创建页面失败", - "Import pages": "导入页面", - "Importing pages": "正在导入页面", - "Page import is in progress. Please do not close this tab.": "页面导入正在进行中。请不要关闭此标签页。", - "Successfully imported": "成功导入", - "Your import is complete.": "导入已完成。", - "Failed to import pages": "导入页面失败", - "Unable to import pages. Please try again.": "无法导入页面。请重试。", - "page": "个页面", - "pages": "个页面", - "Error fetching page data.": "获取页面数据时出错。", - "untitled": "无标题", - "Full width": "全宽", - "Page history": "页面历史", - "Export": "导出", - "Print PDF": "打印 PDF", - "Error loading page history.": "加载页面历史时出错。", - "No page history saved yet.": "尚未保存页面历史。", - "Please confirm your action": "请确认您的操作", - "Are you sure you want to restore this version? Any changes not versioned will be lost.": "您确定要恢复此版本吗?任何未版本化的更改将会丢失。", - "Confirm": "确认", - "Successfully restored": "恢复成功", - "Restore": "恢复" -} diff --git a/apps/client/public/locales/zh/search.json b/apps/client/public/locales/zh/search.json deleted file mode 100644 index 5f848780..00000000 --- a/apps/client/public/locales/zh/search.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Search...": "搜索...", - "Start typing to search...": "开始输入以搜索...", - "No results found...": "未找到结果..." -} diff --git a/apps/client/public/locales/zh/setup-workspace.json b/apps/client/public/locales/zh/setup-workspace.json deleted file mode 100644 index 7943499d..00000000 --- a/apps/client/public/locales/zh/setup-workspace.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Setup workspace": "设置工作空间", - "Create workspace": "创建工作空间", - "Workspace Name": "工作空间名称", - "e.g ACME Inc": "例如:ACME Inc", - "Your Name": "您的姓名", - "enter your full name": "输入您的全名", - "Your Email": "您的电子邮箱", - "Password": "密码", - "Enter a strong password": "输入一个强密码" -} diff --git a/apps/client/public/locales/zh/space.json b/apps/client/public/locales/zh/space.json deleted file mode 100644 index 06414cc9..00000000 --- a/apps/client/public/locales/zh/space.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "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": "最近更新", - "member": "个成员", - "members": "个成员" -} diff --git a/apps/client/public/locales/zh/translation.json b/apps/client/public/locales/zh/translation.json index 1a635c27..ba2acba8 100644 --- a/apps/client/public/locales/zh/translation.json +++ b/apps/client/public/locales/zh/translation.json @@ -1,42 +1,189 @@ { - "common": { - "Failed to fetch recent pages": "获取最近页面失败", - "Untitled": "无标题", - "No pages yet": "暂无页面", - "Failed to load page. An error occurred.": "加载页面失败。发生错误。" - }, - "role": { - "Full access": "完全访问", - "Has full access to space settings and pages": "具有对空间设置和页面的完全访问权限", - "Can edit": "可以编辑", - "Can create and edit pages in space": "可以在空间中创建和编辑页面", - "Can view": "可以查看", - "Can view pages in space but not edit": "可以查看空间中的页面但不能编辑", - "Owner": "所有者", - "Can manage workspace": "可以管理工作区", - "Admin": "管理员", - "Can manage workspace but cannot delete it": "可以管理工作区但不能删除它", - "Member": "成员", - "Can become members of groups and spaces in workspace": "可以成为工作区中群组和空间的成员" - }, - "layout": { - "Home": "首页", - "Workspace": "工作区", - "Workspace settings": "工作区设置", - "Manage members": "管理成员", - "Account": "账户", - "My profile": "我的个人资料", - "My preferences": "我的偏好设置", - "Logout": "退出登录", - "Settings": "设置", - "Profile": "个人资料", - "Preferences": "偏好设置", - "General": "常规", - "Members": "成员", - "Groups": "群组", - "Spaces": "空间" - }, - "home": { - "Recently updated": "最近更新" - } + "Account": "账户", + "Active": "活跃", + "add": "添加", + "Add group members": "添加群组成员", + "Add groups": "添加群组", + "Add members": "添加成员", + "Add to groups": "添加到群组", + "addGroupMembers": "添加群组成员", + "addSpaceMembers": "添加空间成员", + "Admin": "管理员", + "Are you sure you want to delete this group? Members will lose access to resources this group has access to.": "您确定要删除这个群组吗?成员将失去对该群组可访问资源的访问权限。", + "Are you sure you want to delete this page?": "您确定要删除这个页面吗?", + "Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.": "您确定要从群组中移除这个用户吗?该用户将失去对该群组可访问资源的访问权限。", + "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 restore this version? Any changes not versioned will be lost.": "您确定要恢复此版本吗?任何未版本化的更改将会丢失。", + "Can become members of groups and spaces in workspace": "可以成为工作区中群组和空间的成员", + "Can create and edit pages in space": "可以在空间中创建和编辑页面", + "Can edit": "可以编辑", + "Can manage workspace": "可以管理工作区", + "Can manage workspace but cannot delete it": "可以管理工作区但不能删除它", + "Can view": "可以查看", + "Can view pages in space but not edit": "可以查看空间中的页面但不能编辑", + "Cancel": "取消", + "Change email": "更改电子邮箱", + "Change password": "更改密码", + "Change photo": "更改照片", + "Choose a role": "选择一个角色", + "Choose your preferred color scheme.": "选择您喜欢的配色方案。", + "Choose your preferred interface language.": "选择您喜欢的界面语言。", + "Choose your preferred page width.": "选择您喜欢的页面宽度。", + "Confirm": "确认", + "Copy link": "复制链接", + "Create": "创建", + "Create group": "创建群组", + "Create page": "创建页面", + "Create space": "创建空间", + "Create workspace": "创建工作空间", + "Current password": "当前密码", + "Dark": "深色", + "Date": "日期", + "Delete": "删除", + "Delete group": "删除群组", + "deletePageModalContent": "您确定要删除这个页面吗?这将删除其子页面和页面历史记录。此操作不可逆。", + "Description": "描述", + "Details": "详情", + "e.g ACME": "例如:ACME", + "e.g ACME Inc": "例如:ACME Inc", + "e.g Developers": "例如:开发人员", + "e.g Group for developers": "例如:开发人员群组", + "e.g product": "例如:product", + "e.g Product Team": "例如:产品团队", + "e.g Sales": "例如:销售", + "e.g Space for product team": "例如:产品团队的空间", + "e.g Space for sales team to collaborate": "例如:销售团队协作的空间", + "Edit": "编辑", + "Edit group": "编辑群组", + "Email": "电子邮箱", + "Enter a strong password": "输入一个强密码", + "Enter valid email addresses separated by comma or space max_50": "输入有效的电子邮箱地址,用逗号或空格分隔 [最多:50个]", + "enter valid emails addresses": "输入有效的电子邮箱地址", + "Enter your current password": "输入您的当前密码", + "enter your full name": "输入您的全名", + "Enter your new password": "输入您的新密码", + "Enter your new preferred email": "输入您新的首选电子邮箱", + "Enter your password": "输入您的密码", + "Error fetching page data.": "获取页面数据时出错。", + "Error loading page history.": "加载页面历史时出错。", + "Export": "导出", + "Failed to create page": "创建页面失败", + "Failed to delete page": "删除页面失败", + "Failed to fetch recent pages": "获取最近页面失败", + "Failed to import pages": "导入页面失败", + "Failed to load page. An error occurred.": "页面加载失败。发生了一个错误。", + "Failed to update data": "数据更新失败", + "Full access": "完全访问", + "Full page width": "全页宽度", + "Full width": "全宽", + "General": "常规", + "Group": "群组", + "Group description": "群组描述", + "Group name": "群组名称", + "Groups": "群组", + "Has full access to space settings and pages": "具有对空间设置和页面的完全访问权限", + "Home": "首页", + "Import pages": "导入页面", + "Import pages & space settings": "导入页面和空间设置", + "Importing pages": "正在导入页面", + "invalid invitation link": "无效的邀请链接", + "Invitation signup": "邀请注册", + "Invite by email": "通过电子邮箱邀请", + "Invite members": "邀请成员", + "Invite new members": "邀请新成员", + "Invited members who are yet to accept their invitation will appear here.": "尚未接受邀请的成员将显示在这里。", + "Invited members will be granted access to spaces the groups can access": "被邀请的成员将被授予访问群组可以访问的空间的权限", + "Join the workspace": "加入工作空间", + "Language": "语言", + "Light": "浅色", + "Link copied": "链接已复制", + "Login": "登录", + "Logout": "退出登录", + "Manage Group": "管理群组", + "Manage members": "管理成员", + "member": "成员", + "Member": "成员", + "Members": "成员", + "members": "成员", + "My preferences": "我的偏好设置", + "My Profile": "我的个人资料", + "My profile": "我的个人资料", + "Name": "名称", + "New email": "新电子邮箱", + "New page": "新建页面", + "New password": "新密码", + "No group found": "未找到群组", + "No page history saved yet.": "尚未保存页面历史。", + "No pages yet": "暂无页面", + "No results found...": "未找到结果...", + "No user found": "未找到用户", + "Overview": "概览", + "Owner": "所有者", + "page": "个页面", + "Page deleted successfully": "页面已成功删除", + "Page history": "页面历史", + "Page import is in progress. Please do not close this tab.": "页面导入正在进行中。请不要关闭此标签页。", + "Pages": "页面", + "pages": "个页面", + "Password": "密码", + "Password changed successfully": "密码更改成功", + "Pending": "待定", + "Please confirm your action": "请确认您的操作", + "Preferences": "偏好设置", + "Print PDF": "打印 PDF", + "Profile": "个人资料", + "Recently updated": "最近更新", + "Remove": "移除", + "Remove group member": "移除群组成员", + "Remove space member": "移除空间成员", + "Restore": "恢复", + "Role": "角色", + "Save": "保存", + "Search": "搜索", + "Search for groups": "搜索群组", + "Search for users": "搜索用户", + "Search for users and groups": "搜索用户和群组", + "Search...": "搜索...", + "Select language": "选择语言", + "Select role": "选择角色", + "Select role to assign to all invited members": "选择要分配给所有被邀请成员的角色", + "Select theme": "选择主题", + "selectRole": "选择角色", + "Send invitation": "发送邀请", + "Settings": "设置", + "Setup workspace": "设置工作空间", + "Sign In": "登录", + "Sign Up": "注册", + "Slug": "短链接", + "Space": "空间", + "Space description": "空间描述", + "Space menu": "空间菜单", + "Space name": "空间名称", + "Space settings": "空间设置", + "Space slug": "空间短链接", + "Spaces": "空间", + "Spaces you belong to": "您所属的空间", + "Start typing to search...": "开始输入以搜索...", + "Status": "状态", + "Successfully imported": "成功导入", + "Successfully restored": "恢复成功", + "System settings": "系统设置", + "Theme": "主题", + "To change your email, you have to enter your password and new email.": "要更改您的电子邮箱,您需要输入密码和新的电子邮箱地址。", + "Toggle full page width": "切换全页宽度", + "Unable to import pages. Please try again.": "无法导入页面。请重试。", + "untitled": "无标题", + "Untitled": "无标题", + "Updated successfully": "更新成功", + "User": "用户", + "Workspace": "工作区", + "Workspace Name": "工作空间名称", + "Workspace settings": "工作区设置", + "You can change your password here.": "您可以在这里更改密码。", + "Your Email": "您的电子邮箱", + "Your import is complete.": "导入已完成。", + "Your name": "您的姓名", + "Your Name": "您的姓名", + "Your password": "您的密码", + "Your password must be a minimum of 8 characters.": "您的密码必须至少包含8个字符。" } diff --git a/apps/client/public/locales/zh/user.json b/apps/client/public/locales/zh/user.json deleted file mode 100644 index a2ea78ce..00000000 --- a/apps/client/public/locales/zh/user.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "My Profile": "我的个人资料", - "Change photo": "更改照片", - "Name": "姓名", - "Your name": "您的姓名", - "Save": "保存", - "Updated successfully": "更新成功", - "Failed to update data": "数据更新失败", - "Email": "电子邮箱", - "Change email": "更改电子邮箱", - "To change your email, you have to enter your password and new email.": "要更改您的电子邮箱,您需要输入密码和新的电子邮箱地址。", - "Password": "密码", - "Enter your password": "输入您的密码", - "Enter your new preferred email": "输入您新的首选电子邮箱", - "New email": "新电子邮箱", - "You can change your password here.": "您可以在这里更改密码。", - "Change password": "更改密码", - "Your password must be a minimum of 8 characters.": "您的密码必须至少包含8个字符。", - "Current password": "当前密码", - "Enter your current password": "输入您的当前密码", - "New password": "新密码", - "Enter your new password": "输入您的新密码", - "Password changed successfully": "密码更改成功", - "Preferences": "偏好设置", - "Theme": "主题", - "Choose your preferred color scheme.": "选择您喜欢的配色方案。", - "Select theme": "选择主题", - "Light": "浅色", - "Dark": "深色", - "System settings": "系统设置", - "Language": "语言", - "Choose your preferred interface language.": "选择您喜欢的界面语言。", - "Select language": "选择语言", - "Full page width": "全页宽度", - "Choose your preferred page width.": "选择您喜欢的页面宽度。", - "Toggle full page width": "切换全页宽度" -} diff --git a/apps/client/public/locales/zh/workspace.json b/apps/client/public/locales/zh/workspace.json deleted file mode 100644 index 42f15430..00000000 --- a/apps/client/public/locales/zh/workspace.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "General": "常规", - "Name": "名称", - "e.g ACME": "例如:ACME", - "Save": "保存", - "Updated successfully": "更新成功", - "Failed to update data": "数据更新失败", - "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": "发送邀请" -} diff --git a/apps/client/src/App.tsx b/apps/client/src/App.tsx index 79e23f97..049604d9 100644 --- a/apps/client/src/App.tsx +++ b/apps/client/src/App.tsx @@ -29,9 +29,7 @@ import { useTranslation } from "react-i18next"; export default function App() { const [, setSocket] = useAtom(socketAtom); const authToken = useAtomValue(authTokensAtom); - const { t } = useTranslation("translation", { - keyPrefix: "common", - }); + const { t } = useTranslation(); useEffect(() => { if (!authToken?.accessToken) { diff --git a/apps/client/src/components/common/recent-changes.tsx b/apps/client/src/components/common/recent-changes.tsx index f99e6476..c473bad6 100644 --- a/apps/client/src/components/common/recent-changes.tsx +++ b/apps/client/src/components/common/recent-changes.tsx @@ -19,7 +19,7 @@ interface Props { spaceId?: string; } export default function RecentChanges({ spaceId }: Props) { - const { t } = useTranslation("translation", { keyPrefix: "common" }); + const { t } = useTranslation(); const { data: pages, isLoading, isError } = useRecentChangesQuery(spaceId); diff --git a/apps/client/src/components/layouts/global/app-header.tsx b/apps/client/src/components/layouts/global/app-header.tsx index 7016af55..07db245a 100644 --- a/apps/client/src/components/layouts/global/app-header.tsx +++ b/apps/client/src/components/layouts/global/app-header.tsx @@ -16,9 +16,7 @@ import { useTranslation } from "react-i18next"; const links = [{ link: APP_ROUTE.HOME, label: "Home" }]; export function AppHeader() { - const { t } = useTranslation("translation", { - keyPrefix: "layout", - }); + const { t } = useTranslation(); const [mobileOpened] = useAtom(mobileSidebarAtom); const toggleMobile = useToggleSidebar(mobileSidebarAtom); diff --git a/apps/client/src/components/layouts/global/top-menu.tsx b/apps/client/src/components/layouts/global/top-menu.tsx index d30e72e4..690cc305 100644 --- a/apps/client/src/components/layouts/global/top-menu.tsx +++ b/apps/client/src/components/layouts/global/top-menu.tsx @@ -16,9 +16,7 @@ import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import { useTranslation } from "react-i18next"; export default function TopMenu() { - const { t } = useTranslation("translation", { - keyPrefix: "layout", - }); + const { t } = useTranslation(); const [currentUser] = useAtom(currentUserAtom); const { logout } = useAuth(); diff --git a/apps/client/src/components/settings/settings-sidebar.tsx b/apps/client/src/components/settings/settings-sidebar.tsx index 0e1f8438..8ffb7c4a 100644 --- a/apps/client/src/components/settings/settings-sidebar.tsx +++ b/apps/client/src/components/settings/settings-sidebar.tsx @@ -52,9 +52,7 @@ const groupedData: DataGroup[] = [ ]; export default function SettingsSidebar() { - const { t } = useTranslation("translation", { - keyPrefix: "layout", - }); + const { t } = useTranslation(); const location = useLocation(); const [active, setActive] = useState(location.pathname); const navigate = useNavigate(); diff --git a/apps/client/src/components/ui/role-select-menu.tsx b/apps/client/src/components/ui/role-select-menu.tsx index 9434f83c..2184383f 100644 --- a/apps/client/src/components/ui/role-select-menu.tsx +++ b/apps/client/src/components/ui/role-select-menu.tsx @@ -37,9 +37,7 @@ export default function RoleSelectMenu({ onChange, disabled, }: RoleMenuProps) { - const { t } = useTranslation("translation", { - keyPrefix: "role", - }); + const { t } = useTranslation(); return (