From d2ea1ed9215ad7387edbeb057a9b976c25d43417 Mon Sep 17 00:00:00 2001 From: jingyang <72259332+zjy365@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:19:10 +0800 Subject: [PATCH] refactor: enhance i18n type annotations for better developer experience (#4878) * refactor: enhance i18n type annotations for better developer experience * desktop done * fix build * delete script * fix launchpad ci * delete file * update * delete appname as I18nCommonKey * update --- .gitignore | 1 - frontend/.vscode/settings.json | 20 + frontend/desktop/.vscode/settings.json | 19 + frontend/desktop/package.json | 6 +- .../public/locales/en/cloudProviders.json | 20 +- .../desktop/public/locales/en/common.json | 401 +++++++++--------- frontend/desktop/public/locales/en/error.json | 26 +- .../public/locales/zh/cloudProviders.json | 20 +- .../desktop/public/locales/zh/common.json | 387 ++++++++--------- frontend/desktop/public/locales/zh/error.json | 40 +- .../desktop/src/components/AppDock/index.tsx | 2 +- .../account/AccountCenter/AuthModifyList.tsx | 8 +- .../AccountCenter/BindingModifyButton.tsx | 6 +- .../AccountCenter/DeleteAccountModal.tsx | 48 +-- .../account/AccountCenter/PasswordModify.tsx | 16 +- .../AccountCenter/SmsModify/SmsBind.tsx | 24 +- .../AccountCenter/SmsModify/SmsChange.tsx | 46 +- .../AccountCenter/SmsModify/SmsUnbind.tsx | 24 +- .../account/AccountCenter/index.tsx | 26 +- .../mergeUser/NeedToMergeModal.tsx | 16 +- .../desktop/src/components/account/cost.tsx | 28 +- .../desktop/src/components/account/index.tsx | 6 +- .../src/components/app_window/index.tsx | 4 +- .../src/components/desktop_content/apps.tsx | 4 +- .../components/desktop_content/assistant.tsx | 4 +- .../components/desktop_content/monitor.tsx | 14 +- .../components/desktop_content/searchBox.tsx | 8 +- .../src/components/desktop_content/warn.tsx | 2 +- .../src/components/floating_button/index.tsx | 2 +- .../src/components/more_apps/index.tsx | 4 +- .../src/components/more_button/index.tsx | 2 +- .../src/components/notification/index.tsx | 18 +- .../src/components/region/RegionToggle.tsx | 22 +- .../src/components/rightContext/index.tsx | 4 +- .../components/signin/auth/useCustomError.tsx | 9 +- .../components/signin/auth/usePassword.tsx | 19 +- .../components/signin/auth/useProtocol.tsx | 8 +- .../src/components/signin/auth/useSms.tsx | 19 +- .../desktop/src/components/signin/index.tsx | 12 +- .../src/components/team/Abdication.tsx | 6 +- .../src/components/team/CreateTeam.tsx | 8 +- .../src/components/team/DissolveTeam.tsx | 14 +- .../src/components/team/InviteMember.tsx | 10 +- .../src/components/team/ModifyRole.tsx | 2 +- .../src/components/team/NsListItem.tsx | 2 +- .../src/components/team/ReciveMessage.tsx | 10 +- .../src/components/team/RemoveMember.tsx | 14 +- .../src/components/team/TeamCenter.tsx | 16 +- .../src/components/team/WorkspaceToggle.tsx | 2 +- .../desktop/src/components/team/userTable.tsx | 4 +- frontend/desktop/src/hooks/useDriver.tsx | 28 +- .../desktop/src/pages/WorkspaceInvite.tsx | 10 +- frontend/desktop/src/pages/signin.tsx | 2 + frontend/desktop/src/types/i18next.d.ts | 25 ++ frontend/desktop/tsconfig.json | 3 +- frontend/package.json | 7 +- frontend/packages/client-sdk/package.json | 2 +- frontend/pnpm-lock.yaml | 284 +++++++------ frontend/providers/adminer/package.json | 6 +- frontend/providers/applaunchpad/.gitignore | 1 - .../applaunchpad/.vscode/settings.json | 19 + .../applaunchpad/next-i18next.config.js | 5 +- frontend/providers/applaunchpad/package.json | 6 +- .../applaunchpad/src/types/i18next.d.ts | 9 + .../providers/applaunchpad/src/utils/i18n.ts | 5 +- frontend/providers/cloudserver/.gitignore | 1 - frontend/providers/cloudserver/package.json | 6 +- frontend/providers/costcenter/package.json | 6 +- frontend/providers/cronjob/package.json | 8 +- frontend/providers/dbprovider/package.json | 8 +- frontend/providers/invite/package.json | 6 +- frontend/providers/kubepanel/package.json | 3 + frontend/providers/license/package.json | 6 +- frontend/providers/objectstorage/package.json | 6 +- frontend/providers/template/package.json | 6 +- frontend/providers/terminal/package.json | 6 +- frontend/providers/workorder/package.json | 6 +- 77 files changed, 1023 insertions(+), 890 deletions(-) create mode 100644 frontend/.vscode/settings.json create mode 100644 frontend/desktop/.vscode/settings.json create mode 100644 frontend/desktop/src/types/i18next.d.ts create mode 100644 frontend/providers/applaunchpad/.vscode/settings.json create mode 100644 frontend/providers/applaunchpad/src/types/i18next.d.ts diff --git a/.gitignore b/.gitignore index 4411fc345ff..3e238537be2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ tmp **/.DS_Store node_modules vendor -.vscode/ pkg/registry/save/testdata/registry .dummy.report.md deploy/cloud/tars diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json new file mode 100644 index 00000000000..cda4f7e86b9 --- /dev/null +++ b/frontend/.vscode/settings.json @@ -0,0 +1,20 @@ +{ + "i18n-ally.localesPaths": [ + "providers/**/public/locales", + "desktop/public/locales" + ], + "i18n-ally.enabledParsers": [ + "json", + "yaml", + "js", + "ts" + ], + "i18n-ally.keystyle": "nested", + "i18n-ally.sortKeys": true, + "i18n-ally.keepFulfilled": false, + "i18n-ally.sourceLanguage": "zh", + "i18n-ally.displayLanguage": "zh", + "i18n-ally.namespace": true, + "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", + "i18n-ally.extract.targetPickingStrategy": "most-similar-by-key" +} \ No newline at end of file diff --git a/frontend/desktop/.vscode/settings.json b/frontend/desktop/.vscode/settings.json new file mode 100644 index 00000000000..488915e5da7 --- /dev/null +++ b/frontend/desktop/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "i18n-ally.localesPaths": [ + "public/locales" + ], + "i18n-ally.enabledParsers": [ + "json", + "yaml", + "js", + "ts" + ], + "i18n-ally.keystyle": "nested", + "i18n-ally.sortKeys": true, + "i18n-ally.keepFulfilled": false, + "i18n-ally.sourceLanguage": "zh", + "i18n-ally.displayLanguage": "zh", + "i18n-ally.namespace": true, + "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", + "i18n-ally.extract.targetPickingStrategy": "most-similar-by-key" +} \ No newline at end of file diff --git a/frontend/desktop/package.json b/frontend/desktop/package.json index cf49f853ce6..a3ecad8099c 100644 --- a/frontend/desktop/package.json +++ b/frontend/desktop/package.json @@ -42,7 +42,7 @@ "eslint": "8.38.0", "eslint-config-next": "13.3.0", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^10.0.2", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -53,7 +53,7 @@ "mongodb": "^5.9.0", "nanoid": "^4.0.2", "next": "13.3.0", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "next-pwa": "^5.6.0", "nodemailer": "^6.9.13", "nprogress": "^0.2.0", @@ -65,7 +65,7 @@ "react-dom": "18.2.0", "react-draggable": "^4.4.6", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "sass": "^1.68.0", "sealos-desktop-sdk": "workspace:*", "sharp": "^0.32.6", diff --git a/frontend/desktop/public/locales/en/cloudProviders.json b/frontend/desktop/public/locales/en/cloudProviders.json index 853501e3b41..d3d952959d6 100644 --- a/frontend/desktop/public/locales/en/cloudProviders.json +++ b/frontend/desktop/public/locales/en/cloudProviders.json @@ -1,11 +1,11 @@ { - "Volcano Engine": "Volcano Engine", - "Alibaba Cloud": "Alibaba Cloud", - "Tencent Cloud": "Tencent Cloud", - "Google Cloud": "Google Cloud", - "Provider": "Provider", - "Beijing": "Beijing", - "Singapore": "Singapore", - "Guangzhou": "Guangzhou", - "Hangzhou": "Hangzhou" -} + "volcano_engine": "Volcano Engine", + "alibaba_cloud": "Alibaba Cloud", + "tencent_cloud": "Tencent Cloud", + "google_cloud": "Google Cloud", + "provider": "Provider", + "beijing": "Beijing", + "singapore": "Singapore", + "guangzhou": "Guangzhou", + "hangzhou": "Hangzhou" +} \ No newline at end of file diff --git a/frontend/desktop/public/locales/en/common.json b/frontend/desktop/public/locales/en/common.json index 5c133543c0d..e10bca2cf3f 100644 --- a/frontend/desktop/public/locales/en/common.json +++ b/frontend/desktop/public/locales/en/common.json @@ -1,203 +1,204 @@ { - "Cost Center": "Cost Center", - "Laf on Sealos": "Laf on Sealos", - "App Launchpad": "App Launchpad", - "Database": "Database", - "Sealos Document": "Sealos Document", - "Terminal": "Terminal", - "More Apps": "More Apps", - "Message Center": "Message Center", - "Have Read": "Have read", - "Unread": "Unread", - "Read All": "Read All", - "Username": "Username", - "Log Out": "Log Out", - "Log In": "Log In", - "Password Login": "with Password", - "Verification Code Login": "with Phone", - "Loading": "Loading", - "From": "From", - "Balance": "Balance", - "password tips": "Password must be 8 characters or more", - "username tips": "Username must be 3-16 characters, including letters, numbers", - "Password": "Password", - "Change": "Change", - "changePassword": "Change Password", - "currentPassword": "Current Password", - "newPassword": "New Password", - "confirmNewPassword": "Confirm New Password", - "passwordMismatch": "Passwords do not match", - "passwordChangeSuccess": "Password changed successfully", - "currentPasswordRequired": "Current password cannot be empty", - "Verify password": "Verify password", - "verify code tips": "6-digit Verification Code", - "phone number tips": "Phone Number", - "Invalid phone number": "Invalid phone number", - "Invalid username or password": "Invalid username or password", - "Invalid verification code": "Invalid verification code", - "Get code failed": "Get code failed", - "Read and agree": "Please read and agree to the agreement below", - "agree policy": "I have read and agree to the", - "Service Agreement": "Service Agreement", + "abdication": "Abdication", + "accept": "Accept", + "accept_invitation": "Accept Invitation", + "access": "Access", + "account_settings": "Account Settings", + "added": "Added", + "agree_policy": "I have read and agree to the", + "alarm_pod": "Alarm Pod: {{count}}", + "alerts": "Alerts", + "all_apps": "All Apps", + "already_sent_code": "Already sent code", "and": "and", - "Privacy Policy": "Privacy Policy", - "Get Code": "verification", - "Total Amount": "Total Amount", - "Payment Result": "Payment Result", - "Payment Successful": "Payment Successful", - "In Payment": "In Payment ...", - "Bonus": "Bonus", - "Select Amount": "Select Amount", - "View Discount Rules": "View recharge discount rules.", - "Payment Status": "Payment Status", - "Scan with WeChat": "Scan with WeChat", - "Charge": "Charge", - "Order Number": "Order Number", - "Confirm": "Confirm", - "Login to your account": "Login to your account", - "Abdication": "Abdication", - "Team": "Workspace", - "Member List": "Member List", - "Created Time": "Created Time", - "Create Team": "Create Workspace", - "noWorkspaceCreated": "You haven't created a workspace yet", - "Name of Team": "Name of Workspace", - "Dissolve Team": "Delete Workspace", - "Invaild Name of Team": "Invaild Name of Workspace", - "Manage Team": "Manage Workspace", - "Default Team": "Personal Workspace", - "private team ID of user": "User's ID", - "Invite Member": "Invite Member", - "Handle": "Handle", - "Reject": "Reject", - "Accept": "Accept", - "Cancel": "Cancel", - "Quit": "Quit", - "Remove": "Remove", - "Warning": "Warning", - "User Name": "User Name", - "Access": "Access", - "In Time": "In Time", - "Status": "Status", - "Operating": "Operating", - "Waiting": "Waiting", - "Added": "Added", - "Invaild Context": "You need switch to other workspace for handling", - "Remove Member Tips": "Determine that you want to remove the member?", - "Quit Workspace Tips": "Confirm leaving workspace?", - "Invalid User ID": "Invalid User ID", - "The invited user must be others": "The invited user must be others", - "Dissovle Tips": "Deleting the workspace will clear all resources. Are you sure you want to disband", - "Enter Confirm.": "Please enter {{value}} to confirm", - "Accept Invitation": "Accept Invitation", - "Receive Tips": "{{managerName}} invite you join in {{teamName}} as {{role}}", - "Invite members to workspace ": "Invite members to workspace {{workspace}}", - "Generate invitation link": "Generate invitation link", - "Failed to generate invitation link": "Failed to generate invitation link", - "Redirecting to homepage in 3 seconds": "Redirecting to homepage in 3 seconds", - "Invalid invitation link": "Invalid invitation link", - "Invitation reminder": "Invitation reminder", - "pay with stripe": "Pay With Stripe", - "pay with wechat": "Pay With Wechat", - "License Buy": "License Buy", - "Purchase History": "Purchase History", - "Purchase License": "Purchase License", - "Remaining Time": "Remaining Time: ", - "Please read and agree to the agreement": "Please read and agree to the agreement", - "Purchase Link Error": "Purchase Link Error", - "You have not purchased the License": "You have not purchased the License", - "App Info": "App Info", - "Click anywhere to continue": "Click on any blank space to continue", - "Jump Over": "Jump Over", - "Detail": "Detail", - "Hello, welcome": "Hello, welcome to", - "Quick application switching floating ball": "Quick application switching floating ball", - "You can use the kubectl command directly from the terminal": "You can use the kubectl command directly from the terminal", - "Help you enable high availability database": "Help you enable high availability database", - "Launch various third-party applications with one click": "Launch various third-party applications with one click", - "You can view fees through the fee center": "You can view fees through the fee center", - "deploy an application": "Let’s deploy an application~", + "app_info": "App Info", + "app_launchpad": "App Launchpad", + "avatar": "Avatar", + "balance": "Balance", + "bind": "Bind", + "bind_success": "Binding successful", + "bonus": "Bonus", + "bound": "Bound", + "cancel": "Cancel", + "change": "Change", + "change_binding": "Change Binding", + "changeemail": "Modify email", + "changepassword": "Change Password", + "changephone": "Change Phone", + "charge": "Charge", + "click_anywhere_to_continue": "Click on any blank space to continue", + "click_on_any_shadow_to_skip": "Click on any shadow to skip", + "completed_the_deployment_of_an_nginx_for_the_first_time": "Completed the deployment of an nginx for the first time", + "confirm": "Confirm", + "confirmnewpassword": "Confirm New Password", + "core": "Core", + "cost_center": "Cost Center", + "create_team": "Create Workspace", + "created_time": "Created Time", + "currentpassword": "Current Password", + "currentpasswordrequired": "Current password cannot be empty", + "database": "Database", + "day": "Day", + "default_team": "Personal Workspace", + "delete_account": "Delete account", + "delete_account_button": "Delete", + "delete_account_caution": "Once a resource is deleted, it cannot be recovered. \nTherefore, before performing the above operations, please be sure to back up your data.", + "delete_account_tips": "Permanently delete this account and all its content.", + "delete_account_title": "Logout prompt", + "delete_account_tips2": "The account you are trying to bind has been used by another user. You can choose to merge the accounts to unify the management of your information and settings. Would you like to merge the accounts now?", + "deleteaccounttitle": "Sealos will permanently delete this account.", + "deletemyaccount": "DeleteMyAccount", + "deploy_an_application": "Let’s deploy an application~", + "description": "Description", + "detail": "Detail", + "dissolve_team": "Delete Workspace", + "dissovle_tips": "Deleting the workspace will clear all resources. Are you sure you want to disband", + "doc": "Doc", + "email": "Email", + "emailchangesuccess": "Email modified successfully", + "enter": "Enter", + "enter_confirm": "Please enter {{value}} to confirm", + "expected_to_use_next_month": "Expected to use next month", + "expected_used": "Expected used", + "failed_to_generate_invitation_link": "Failed to generate invitation link", + "flow": "Flow", + "from": "From", + "generate_invitation_link": "Generate invitation link", + "get_code": "verification", + "get_code_failed": "Get code failed", + "gift_amount": "Reward {{amount}} balance.", + "github": "Github", + "google": "Google", + "handle": "Handle", + "have_read": "Have read", + "healthy_pod": "Healthy Pod: {{count}}", + "hello_welcome": "Hello, welcome to", + "help_you_enable_high_availability_database": "Help you enable high availability database", + "in_payment": "In Payment ...", + "in_time": "In Time", + "insufficient_balance_tips": "There is currently an outstanding balance in your account. In order to successfully complete the account cancellation process, please settle the outstanding balance first.", + "invaild_context": "You need switch to other workspace for handling", + "invaild_name_of_team": "Invaild Name of Workspace", + "invalid_email": "Invalid email", + "invalid_invitation_link": "Invalid invitation link", + "invalid_phone_number": "Invalid phone number", + "invalid_user_id": "Invalid User ID", + "invalid_username_or_password": "Invalid username or password", + "invalid_verification_code": "Invalid verification code", + "invitation_reminder": "Invitation reminder", + "invite_member": "Invite Member", + "invite_members_to_workspace_": "Invite members to workspace {{workspace}}", + "irreversibleactiontips": "This action is irreversible, please proceed with caution.", + "jump_over": "Jump Over", + "laf_on_sealos": "Laf on Sealos", + "language": "Language", + "launch_various_third-party_applications_with_one_click": "Launch various third-party applications with one click", + "license_buy": "License Buy", + "loading": "Loading", + "log_in": "Log In", + "log_out": "Log Out", + "login_to_your_account": "Login to your account", + "manage_team": "Manage Workspace", + "member_list": "Member List", + "memory": "Memory", + "merge": "merge", + "merge_account_title": "Account has been bound", + "mergeaccounttips1": "The account you are trying to bind has been used by another user. Due to conflicting binding methods, the accounts cannot be merged.", + "message_center": "Message Center", + "monitor": "Monitor", + "more_apps": "More Apps", + "name_of_team": "Name of Workspace", + "new_email": "New email", + "new_phone": "New mobile number", + "newpassword": "New Password", + "next": "Next", + "next_time": "Next", + "nickname": "Nickname", + "no_apps_found": "No Apps Found", + "noworkspacecreated": "You haven't created a workspace yet", + "official_account_login": "Official account login", + "old_email": "Old email", + "old_phone": "old mobile number", + "operating": "Operating", + "order_number": "Order Number", + "password": "Password", + "password_login": "with Password", + "password_tips": "Password must be 8 characters or more", + "passwordchangesuccess": "Password changed successfully", + "password_mis_match": "Passwords do not match", + "pay_with_stripe": "Pay With Stripe", + "pay_with_wechat": "Pay With Wechat", + "payment_result": "Payment Result", + "payment_status": "Payment Status", + "payment_successful": "Payment Successful", + "phone": "Phone", + "phone_number_tips": "Phone Number", + "phonechangesuccess": "Mobile phone number modified successfully", + "please_read_and_agree_to_the_agreement": "Please read and agree to the agreement", + "privacy_policy": "Privacy Policy", + "private_team_id_of_user": "User's ID", + "purchase_history": "Purchase History", + "purchase_license": "Purchase License", + "purchase_link_error": "Purchase Link Error", + "quick_application_switching_floating_ball": "Quick application switching floating ball", + "quit": "Quit", + "quit_workspace_tips": "Confirm leaving workspace?", + "read_all": "Read All", + "read_and_agree": "Please read and agree to the agreement below", + "receive_tips": "{{managerName}} invite you join in {{teamName}} as {{role}}", + "recharge_amount": "Recharge Amount", + "redirecting_to_homepage_in_3_seconds": "Redirecting to homepage in 3 seconds", + "region": "Region", + "reject": "Reject", + "remain_app_tips": "There are still undeleted application resources in your account. To help you smoothly complete the account cancellation process, please manually delete all application resources to avoid data loss", + "remain_database_tips": "There are still undeleted database resources in your account. To help you smoothly complete the account cancellation process, please manually delete all database resources to avoid data loss", + "remain_objectstorage_tips": "There are still undeleted object storage resources in your account. To help you smoothly complete the account cancellation process, please manually delete all object storage resources to avoid data loss", + "remain_other_region_resource_tips": "There are still associated resources that have not been deleted in your account. To help you successfully complete the account cancellation process, please clean up all region resources to ensure that nothing is missing.", + "remain_template_tips": "There are still undeleted template resources in your account. To help you smoothly complete the account cancellation process, please manually delete all template resources to avoid data loss", + "remain_workspace_tips": "There are still undeleted associated resources in your account. To help you successfully complete the account cancellation process, please clean up or transfer your workspace to avoid data loss.", + "remaining_time": "Remaining Time: ", + "remove": "Remove", + "remove_member_tips": "Determine that you want to remove the member?", + "scan_with_wechat": "Scan with WeChat", + "sealos_copilot": "Sealos Copilot", + "sealos_document": "Sealos Document", + "search_apps": "Search Apps", + "select_amount": "Select Amount", + "service_agreement": "Service Agreement", "spend": "spend", - "Completed the deployment of an nginx for the first time": "Completed the deployment of an nginx for the first time", - "Next time": "Next", - "start immediately": "Start", - "Click on any shadow to skip": "Click on any shadow to skip", - "Start your Sealos journey": "Start your Sealos journey", - "gift amount": "Reward {{amount}} balance.", - "Recharge Amount": "Recharge Amount", - "Doc": "Doc", - "Official account login": "Official account login", - "Region": "Region", - "Year": "Year", - "Core": "Core", - "Yuan": "Yuan", - "Description": "Description", - "All Apps": "All Apps", - "Account Settings": "Account Settings", - "Alerts": "Alerts", - "Monitor": "Monitor", - "Used Resources": "Used Resources", - "Memory": "Memory", - "Storage": "Storage", - "Flow": "Flow", - "Healthy Pod": "Healthy Pod: {{count}}", - "Alarm Pod": "Alarm Pod: {{count}}", - "Expected used": "Expected used", - "Used last month": "Used last month", - "Expected to use next month": "Expected to use next month", - "Day": "Day", - "Search Apps": "Search Apps", - "No Apps Found": "No Apps Found", - "Switching Disc": "Switching Disc", - "Toggle App Bar": "Toggle App Bar", - "Work Order": "Work Order", - "Under active development": "Under active development 🚧", - "Sealos Copilot": "Sealos Copilot", - "Avatar": "Avatar", - "Nickname": "Nickname", - "Language": "Language", - "Phone": "Phone", - "Github": "Github", - "Wechat": "Wechat", - "Bound": "Bound", - "Bind": "Bind", - "Unbound": "Unbound", - "Unbind": "Unbind", - "Change Binding": "Change Binding", - "verifyCode": "verification", - "Already Sent Code": "Already sent code", - "changePhone": "Change Phone", - "Delete account": "Delete account", - "Delete Account Tips": "Permanently delete this account and all its content.", - "Delete Account Button": "Delete", - "Delete Account Title": "Logout prompt", - "deleteMyAccount": "DeleteMyAccount", - "INSUFFICIENT_BALANCE_tips": "There is currently an outstanding balance in your account. In order to successfully complete the account cancellation process, please settle the outstanding balance first.", - "Remain App Tips": "There are still undeleted application resources in your account. To help you smoothly complete the account cancellation process, please manually delete all application resources to avoid data loss", - "Remain Template Tips": "There are still undeleted template resources in your account. To help you smoothly complete the account cancellation process, please manually delete all template resources to avoid data loss", - "Remain ObjectStorage Tips": "There are still undeleted object storage resources in your account. To help you smoothly complete the account cancellation process, please manually delete all object storage resources to avoid data loss", - "Remain Database Tips": "There are still undeleted database resources in your account. To help you smoothly complete the account cancellation process, please manually delete all database resources to avoid data loss", - "Remain Workspace Tips": "There are still undeleted associated resources in your account. To help you successfully complete the account cancellation process, please clean up or transfer your workspace to avoid data loss.", - "Remain Other Region Resource Tips": "There are still associated resources that have not been deleted in your account. To help you successfully complete the account cancellation process, please clean up all region resources to ensure that nothing is missing.", - "Delete Account Caution": "Once a resource is deleted, it cannot be recovered. \nTherefore, before performing the above operations, please be sure to back up your data.", - "Enter": "Enter", - "Google": "Google", - "Merge Account Title": "Account has been bound", - "Merge": "merge", - "phoneChangeSuccess": "Mobile phone number modified successfully", - "Bind Success": "Binding successful", - "Old Phone": "old mobile number", - "Next": "Next", - "New Phone": "New mobile number", - "Unbind Success": "Unbinding successfully", - "Invalid Email": "Invalid email", - "Email": "Email", - "Old Email": "Old email", - "New Email": "New email", - "emailChangeSuccess": "Email modified successfully", - "changeEmail": "Modify email", - "IrreversibleActionTips": "This action is irreversible, please proceed with caution.", - "DeleteAccountTitle": "Sealos will permanently delete this account.", - "MergeAccountTips1": "The account you are trying to bind has been used by another user. Due to conflicting binding methods, the accounts cannot be merged.", - "DeleteAccountTips2": "The account you are trying to bind has been used by another user. You can choose to merge the accounts to unify the management of your information and settings. Would you like to merge the accounts now?" -} + "start_immediately": "Start", + "start_your_sealos_journey": "Start your Sealos journey", + "status": "Status", + "storage": "Storage", + "submit_error": "Submit Error", + "switching_disc": "Switching Disc", + "team": "Workspace", + "terminal": "Terminal", + "the_invited_user_must_be_others": "The invited user must be others", + "toggle_app_bar": "Toggle App Bar", + "total_amount": "Total Amount", + "unbind": "Unbind", + "unbind_success": "Unbinding successfully", + "unbound": "Unbound", + "under_active_development": "Under active development 🚧", + "unread": "Unread", + "used_last_month": "Used last month", + "used_resources": "Used Resources", + "user_name": "User Name", + "username": "Username", + "username_tips": "Username must be 3-16 characters, including letters, numbers", + "verification_code_login": "with Phone", + "verify_code_tips": "6-digit Verification Code", + "verify_password": "Verify password", + "verifycode": "verification", + "view_discount_rules": "View recharge discount rules.", + "waiting": "Waiting", + "warning": "Warning", + "wechat": "Wechat", + "work_order": "Work Order", + "year": "Year", + "you_can_use_the_kubectl_command_directly_from_the_terminal": "You can use the kubectl command directly from the terminal", + "you_can_view_fees_through_the_fee_center": "You can view fees through the fee center", + "you_have_not_purchased_the_license": "You have not purchased the License", + "yuan": "Yuan" +} \ No newline at end of file diff --git a/frontend/desktop/public/locales/en/error.json b/frontend/desktop/public/locales/en/error.json index 46e13a6e113..caef159d793 100644 --- a/frontend/desktop/public/locales/en/error.json +++ b/frontend/desktop/public/locales/en/error.json @@ -8,17 +8,15 @@ "INSUFFICENT_BALANCE": "Insufficient balance", "ACCOUNT_NOT_FOUND": "Account not found", "USER_CR_NOT_FOUND": "User CR not found", -"OAUTHPROVIDER_NOT_FOUND": "OAuth provider not found", -"PRIVATE_WORKSPACE_NOT_FOUND": "Private workspace not found", -"GET_RESOURCE_ERROR": "Get resource error", -"REMAIN_OTHER_REGION_RESOURCE": "Remaining resources in other region", -"REMAIN_WORKSACE_OWNER": "Remaining workspace owner in current region", -"REMAIN_CVM": "Remaining cloud virtual machine in current region", -"REMAIN_APP": "Remaining applications in current region", -"REMAIN_TEMPLATE": "Remaining templates in current region", -"REMAIN_OBJECT_STORAGE": "Remaining object storage in current region", -"REMAIN_DATABASE": "Remaining databases in current region", -"KUBECONFIG_NOT_FOUND": "Kubeconfig not found" - } - - \ No newline at end of file + "OAUTHPROVIDER_NOT_FOUND": "OAuth provider not found", + "PRIVATE_WORKSPACE_NOT_FOUND": "Private workspace not found", + "GET_RESOURCE_ERROR": "Get resource error", + "REMAIN_OTHER_REGION_RESOURCE": "Remaining resources in other region", + "REMAIN_WORKSACE_OWNER": "Remaining workspace owner in current region", + "REMAIN_CVM": "Remaining cloud virtual machine in current region", + "REMAIN_APP": "Remaining applications in current region", + "REMAIN_TEMPLATE": "Remaining templates in current region", + "REMAIN_OBJECT_STORAGE": "Remaining object storage in current region", + "REMAIN_DATABASE": "Remaining databases in current region", + "KUBECONFIG_NOT_FOUND": "Kubeconfig not found" +} \ No newline at end of file diff --git a/frontend/desktop/public/locales/zh/cloudProviders.json b/frontend/desktop/public/locales/zh/cloudProviders.json index e4c2056e48b..e88b5813933 100644 --- a/frontend/desktop/public/locales/zh/cloudProviders.json +++ b/frontend/desktop/public/locales/zh/cloudProviders.json @@ -1,11 +1,11 @@ { - "Volcano Engine": "火山引擎", - "Alibaba Cloud": "阿里云", - "Tencent Cloud": "腾讯云", - "Google Cloud": "谷歌云", - "Provider": "供应商", - "Beijing": "北京", - "Singapore": "新加坡", - "Guangzhou": "广州", - "Hangzhou": "杭州" -} + "volcano_engine": "火山引擎", + "alibaba_cloud": "阿里云", + "tencent_cloud": "腾讯云", + "google_cloud": "谷歌云", + "provider": "供应商", + "beijing": "北京", + "singapore": "新加坡", + "guangzhou": "广州", + "hangzhou": "杭州" +} \ No newline at end of file diff --git a/frontend/desktop/public/locales/zh/common.json b/frontend/desktop/public/locales/zh/common.json index 167eef87c26..25f0d3f23a6 100644 --- a/frontend/desktop/public/locales/zh/common.json +++ b/frontend/desktop/public/locales/zh/common.json @@ -1,196 +1,197 @@ { - "More Apps": "更多应用", - "Message Center": "消息中心", - "Have Read": "已读", - "Unread": "未读", - "Read All": "全部已读", - "Username": "用户名", - "Password Login": "密码登录", - "Verification Code Login": "手机号登录", - "Password": "密码", - "Log In": "登录", - "Loading": "加载中", - "Log Out": "登出", - "From": "来自", - "Balance": "余额", - "verify code tips": "6位验证码", - "phone number tips": "手机号", - "password tips": "密码为8位以上字符", - "username tips": "用户名为3-16位的英文或数字的字符", - "currentPasswordRequired": "当前密码不能为空", - "changePassword": "修改密码", - "currentPassword": "当前密码", - "newPassword": "新密码", - "confirmNewPassword": "确认新密码", - "passwordMismatch": "密码不一致", - "passwordChangeSuccess": "密码修改成功", - "Verify password": "确认密码", - "Change": "变更", - "Invalid username or password": "用户名或密码错误", - "Invalid phone number": "无效的手机号", - "Invalid verification code": "无效的验证码", - "Get code failed": "获取验证码失败", - "Read and agree": "请阅读并同意下方协议", - "agree policy": "我已阅读并同意", + "abdication": "移交", + "accept": "接受", + "accept_invitation": "接受邀请", + "access": "权限", + "account_settings": "账户设置", + "added": "已加入", + "agree_policy": "我已阅读并同意", + "alarm_pod": "告警 Pod: {{count}}", + "alerts": "告警", + "all_apps": "所有应用", + "already_sent_code": "已经发送验证码", "and": "和", - "Service Agreement": "服务协议", - "Privacy Policy": "隐私政策", - "Get Code": "获取验证码", - "Bonus": "赠", - "Payment Result": "支付结果", - "Payment Successful": "支付成功", - "In Payment": "支付中 ...", - "Recharge Amount": "充值金额", - "Select Amount": "选择金额", - "View Discount Rules": "查看优惠规则", - "Payment Status": "支付状态", - "Scan with WeChat": "微信扫码支付", - "Charge": "充值", - "Order Number": "订单号", - "Confirm": "确认", - "Login to your account": "登录您的帐户", - "Abdication": "移交", - "Team": "工作空间", - "Member List": "成员列表", - "Created Time": "创建时间", - "Create Team": "创建工作空间", - "noWorkspaceCreated": "您还没有创建工作空间", - "Name of Team": "工作空间名称", - "Dissolve Team": "删除", - "Invaild Name of Team": "不合法的工作空间名称", - "Manage Team": "管理工作空间", - "Default Team": "个人空间", - "private team ID of user": "用户ID", - "Invite Member": "邀请成员", - "Handle": "操作", - "Reject": "拒绝", - "Accept": "接受", - "Cancel": "取消", - "Quit": "退出", - "Remove": "移除", - "Warning": "警告", - "User Name": "用户名", - "Access": "权限", - "In Time": "加入时间", - "Status": "状态", - "Operating": "操作", - "Waiting": "等待中", - "Added": "已加入", - "Invaild Context": "你需要切换到其他工作空间操作", - "Remove Member Tips": "确认要移除该成员?", - "Quit Workspace Tips": "确认要退出工作空间吗?", - "Invalid User ID": "用户的 ID 不合法", - "The invited user must be others": "只能邀请其他人", - "Dissovle Tips": "删除工作空间会清空所有资源,确定要删除吗?", - "Enter Confirm.": "请输入 {{value}} 确认", - "Accept Invitation": "接受邀请", - "Receive Tips": "{{managerName}} 邀请你到 {{teamName}} 成为 {{role}}", - "Invite members to workspace": "邀请成员至工作空间 {{workspace}}", - "Generate invitation link": "生成邀请链接", - "Failed to generate invitation link": "生成邀请链接失败", - "Redirecting to homepage in 3 seconds": "3秒后跳回主页", - "Invalid invitation link": "邀请链接非法", - "Invitation reminder": "受邀提醒", - "pay with wechat": "微信支付", - "pay with stripe": "Stripe 支付", - "License Buy": "License 购买", - "Purchase History": "购买记录", - "Purchase License": "购买 License", - "Remaining Time": "剩余激活时间: ", - "Please read and agree to the agreement": "请阅读并同意协议", - "Purchase Link Error": "购买链接错误", - "You have not purchased the License": "您还没有购买 License", - "App Info": "应用信息", - "Click anywhere to continue": "点击任意空白继续", - "Jump Over": "跳过", - "Detail": "详情", - "Hello, welcome": "您好, 欢迎来到", - "Quick application switching floating ball": "快捷应用切换悬浮球", - "You can use the kubectl command directly from the terminal": "您可通过终端直接使用 kubectl 命令", - "Help you enable high availability database": "帮您启用高可用数据库", - "Launch various third-party applications with one click": "一键启动各种第三方应用", - "You can view fees through the fee center": "您可通过费用中心查看费用", - "deploy an application": "来部署一个应用吧~", + "app_info": "应用信息", + "avatar": "头像", + "balance": "余额", + "bind": "绑定", + "bind_success": "绑定成功", + "bonus": "赠", + "bound": "已绑定", + "cancel": "取消", + "change": "变更", + "change_binding": "改绑", + "changeemail": "修改电子邮箱", + "changepassword": "修改密码", + "changephone": "更改手机号", + "charge": "充值", + "click_anywhere_to_continue": "点击任意空白继续", + "click_on_any_shadow_to_skip": "点击任意阴影跳过", + "completed_the_deployment_of_an_nginx_for_the_first_time": "部署一个 nginx ,首次完成 将", + "confirm": "确认", + "confirmnewpassword": "确认新密码", + "core": "核", + "create_team": "创建工作空间", + "created_time": "创建时间", + "currentpassword": "当前密码", + "currentpasswordrequired": "当前密码不能为空", + "day": "天", + "default_team": "个人空间", + "delete_account": "注销账号", + "delete_account_button": "注销", + "delete_account_caution": "资源一旦删除,将不可恢复。因此,在执行以上操作前,请务必做好数据备份工作", + "delete_account_tips": "将永久删除此账户及其所有内容", + "delete_account_title": "注销提示", + "delete_account_tips2": "您尝试绑定的账号已被其他用户使用。您可以选择合并账户,以统一管理您的信息和设置。是否现在合并账户?", + "deleteaccounttitle": "Sealos 将永久删除此账户。", + "deletemyaccount": "删除我的账号", + "deploy_an_application": "来部署一个应用吧~", + "description": "描述", + "detail": "详情", + "dissolve_team": "删除", + "dissovle_tips": "删除工作空间会清空所有资源,确定要删除吗?", + "doc": "文档", + "email": "电子邮箱", + "emailchangesuccess": "电子邮箱修改成功", + "enter": "输入", + "enter_confirm": "请输入 {{value}} 确认", + "expected_to_use_next_month": "下月预计使用", + "expected_used": "预计还能使用", + "failed_to_generate_invitation_link": "生成邀请链接失败", + "flow": "流量", + "from": "来自", + "generate_invitation_link": "生成邀请链接", + "get_code": "获取验证码", + "get_code_failed": "获取验证码失败", + "gift_amount": "赠送 {{amount}} 余额.", + "github": "Github", + "google": "Google", + "handle": "操作", + "have_read": "已读", + "healthy_pod": "健康 Pod: {{count}}", + "hello_welcome": "您好, 欢迎来到", + "help_you_enable_high_availability_database": "帮您启用高可用数据库", + "in_payment": "支付中 ...", + "in_time": "加入时间", + "insufficient_balance_tips": "您的账户目前存在未结清的款项,为了顺利完成账户注销流程,请先结清欠款。", + "invaild_context": "你需要切换到其他工作空间操作", + "invaild_name_of_team": "不合法的工作空间名称", + "invalid_email": "无效的电子邮箱", + "invalid_invitation_link": "邀请链接非法", + "invalid_phone_number": "无效的手机号", + "invalid_user_id": "用户的 ID 不合法", + "invalid_username_or_password": "用户名或密码错误", + "invalid_verification_code": "无效的验证码", + "invitation_reminder": "受邀提醒", + "invite_member": "邀请成员", + "invite_members_to_workspace": "邀请成员至工作空间 {{workspace}}", + "irreversibleactiontips": "此操作不可逆转,请谨慎操作", + "jump_over": "跳过", + "language": "语言", + "launch_various_third-party_applications_with_one_click": "一键启动各种第三方应用", + "license_buy": "License 购买", + "loading": "加载中", + "log_in": "登录", + "log_out": "登出", + "login_to_your_account": "登录您的帐户", + "manage_team": "管理工作空间", + "member_list": "成员列表", + "memory": "内存", + "merge": "合并", + "merge_account_title": "账户已被绑定", + "mergeaccounttips1": "您尝试绑定的账号已被其他用户使用。由于存在冲突的其他绑定方式,无法合并账户。", + "message_center": "消息中心", + "monitor": "监控", + "more_apps": "更多应用", + "name_of_team": "工作空间名称", + "new_email": "新电子邮箱", + "new_phone": "新手机号", + "newpassword": "新密码", + "next": "下一步", + "next_time": "下次吧", + "nickname": "昵称", + "no_apps_found": "未找到任何应​​用", + "noworkspacecreated": "您还没有创建工作空间", + "official_account_login": "公众号登录", + "old_email": "旧电子邮箱", + "old_phone": "旧手机号", + "operating": "操作", + "order_number": "订单号", + "password": "密码", + "password_login": "密码登录", + "password_tips": "密码为8位以上字符", + "passwordchangesuccess": "密码修改成功", + "password_mis_match": "密码不一致", + "pay_with_stripe": "Stripe 支付", + "pay_with_wechat": "微信支付", + "payment_result": "支付结果", + "payment_status": "支付状态", + "payment_successful": "支付成功", + "phone": "手机号", + "phone_number_tips": "手机号", + "phonechangesuccess": "手机号修改成功", + "please_read_and_agree_to_the_agreement": "请阅读并同意协议", + "privacy_policy": "隐私政策", + "private_team_id_of_user": "用户ID", + "purchase_history": "购买记录", + "purchase_license": "购买 License", + "purchase_link_error": "购买链接错误", + "quick_application_switching_floating_ball": "快捷应用切换悬浮球", + "quit": "退出", + "quit_workspace_tips": "确认要退出工作空间吗?", + "read_all": "全部已读", + "read_and_agree": "请阅读并同意下方协议", + "receive_tips": "{{managerName}} 邀请你到 {{teamName}} 成为 {{role}}", + "recharge_amount": "充值金额", + "redirecting_to_homepage_in_3_seconds": "3秒后跳回主页", + "region": "可用区", + "reject": "拒绝", + "remain_app_tips": "您的账户中仍有未删除的应用资源,为了帮助您顺利完成账户注销流程,请您手动删除所有应用资源,以避免数据丢失", + "remain_database_tips": "您的账户中仍有未删除的数据库资源,为了帮助您顺利完成账户注销流程,请您手动删除所有数据库资源,以避免数据丢失", + "remain_objectstorage_tips": "您的账户中仍有未删除的对象存储资源,为了帮助您顺利完成账户注销流程,请您手动删除所有对象存储资源,以避免数据丢失", + "remain_other_region_resource_tips": "您好,您的账户中仍有未删除的关联资源,为了帮助您顺利完成账户注销流程,请您清理所有可用区资源,确保无遗漏。", + "remain_template_tips": "您的账户中仍有未删除的模板资源,为了帮助您顺利完成账户注销流程,请您手动删除所有模板资源,以避免数据丢失", + "remain_workspace_tips": "您的账户中仍有未删除的关联资源,为了帮助您顺利完成账户注销流程,请您清理或转移您的工作空间,以避免数据丢失", + "remaining_time": "剩余激活时间: ", + "remove": "移除", + "remove_member_tips": "确认要移除该成员?", + "scan_with_wechat": "微信扫码支付", + "sealos_copilot": "Sealos 小助理", + "search_apps": "搜索应用", + "select_amount": "选择金额", + "service_agreement": "服务协议", "spend": "花", - "Completed the deployment of an nginx for the first time": "部署一个 nginx ,首次完成 将", - "Next time": "下次吧", - "start immediately": "立即开始", - "Click on any shadow to skip": "点击任意阴影跳过", - "Start your Sealos journey": "开始您的 Sealos 之旅", - "gift amount": "赠送 {{amount}} 余额.", - "Doc": "文档", - "Official account login": "公众号登录", - "Region": "可用区", - "Year": "年", - "Core": "核", - "Yuan": "元", - "Description": "描述", - "All Apps": "所有应用", - "Account Settings": "账户设置", - "Alerts": "告警", - "Monitor": "监控", - "Used Resources": "已用资源", - "Memory": "内存", - "Storage": "存储", - "Flow": "流量", - "Healthy Pod": "健康 Pod: {{count}}", - "Alarm Pod": "告警 Pod: {{count}}", - "Expected used": "预计还能使用", - "Used last month": "上月已使用", - "Expected to use next month": "下月预计使用", - "Day": "天", - "Search Apps": "搜索应用", - "No Apps Found": "未找到任何应​​用", - "Switching Disc": "切换圆盘", - "Toggle App Bar": "切换应用栏", - "Work Order": "工单", - "Under active development": "正在积极开发中 🚧", - "Sealos Copilot": "Sealos 小助理", - "Avatar": "头像", - "Nickname": "昵称", - "Language": "语言", - "Phone": "手机号", - "Github": "Github", - "Wechat": "微信", - "Bound": "已绑定", - "Bind": "绑定", - "Unbound": "未绑定", - "Unbind": "解绑", - "Change Binding": "改绑", - "verifyCode": "验证码", - "Already Sent Code": "已经发送验证码", - "changePhone": "更改手机号", - "Delete account": "注销账号", - "Delete Account Tips": "将永久删除此账户及其所有内容", - "Delete Account Button": "注销", - "Delete Account Title": "注销提示", - "deleteMyAccount": "删除我的账号", - "INSUFFICIENT_BALANCE_tips": "您的账户目前存在未结清的款项,为了顺利完成账户注销流程,请先结清欠款。", - "Remain App Tips": "您的账户中仍有未删除的应用资源,为了帮助您顺利完成账户注销流程,请您手动删除所有应用资源,以避免数据丢失", - "Remain Template Tips": "您的账户中仍有未删除的模板资源,为了帮助您顺利完成账户注销流程,请您手动删除所有模板资源,以避免数据丢失", - "Remain ObjectStorage Tips": "您的账户中仍有未删除的对象存储资源,为了帮助您顺利完成账户注销流程,请您手动删除所有对象存储资源,以避免数据丢失", - "Remain Database Tips": "您的账户中仍有未删除的数据库资源,为了帮助您顺利完成账户注销流程,请您手动删除所有数据库资源,以避免数据丢失", - "Remain Workspace Tips": "您的账户中仍有未删除的关联资源,为了帮助您顺利完成账户注销流程,请您清理或转移您的工作空间,以避免数据丢失", - "Remain Other Region Resource Tips": "您好,您的账户中仍有未删除的关联资源,为了帮助您顺利完成账户注销流程,请您清理所有可用区资源,确保无遗漏。", - "Delete Account Caution": "资源一旦删除,将不可恢复。因此,在执行以上操作前,请务必做好数据备份工作", - "Enter": "输入", - "Google": "Google", - "Merge Account Title": "账户已被绑定", - "Merge": "合并", - "phoneChangeSuccess": "手机号修改成功", - "Bind Success": "绑定成功", - "Old Phone": "旧手机号", - "Next": "下一步", - "New Phone": "新手机号", - "Unbind Success": "解绑成功", - "Invalid Email": "无效的电子邮箱", - "Email": "电子邮箱", - "Old Email": "旧电子邮箱", - "New Email": "新电子邮箱", - "emailChangeSuccess": "电子邮箱修改成功", - "changeEmail": "修改电子邮箱", - "IrreversibleActionTips": "此操作不可逆转,请谨慎操作", - "DeleteAccountTitle": "Sealos 将永久删除此账户。", - "MergeAccountTips1": "您尝试绑定的账号已被其他用户使用。由于存在冲突的其他绑定方式,无法合并账户。", - "DeleteAccountTips2": "您尝试绑定的账号已被其他用户使用。您可以选择合并账户,以统一管理您的信息和设置。是否现在合并账户?" -} + "start_immediately": "立即开始", + "start_your_sealos_journey": "开始您的 Sealos 之旅", + "status": "状态", + "storage": "存储", + "submit_error": "提交错误", + "switching_disc": "切换圆盘", + "team": "工作空间", + "the_invited_user_must_be_others": "只能邀请其他人", + "toggle_app_bar": "切换应用栏", + "unbind": "解绑", + "unbind_success": "解绑成功", + "unbound": "未绑定", + "under_active_development": "正在积极开发中 🚧", + "unread": "未读", + "used_last_month": "上月已使用", + "used_resources": "已用资源", + "user_name": "用户名", + "username": "用户名", + "username_tips": "用户名为3-16位的英文或数字的字符", + "verification_code_login": "手机号登录", + "verify_code_tips": "6位验证码", + "verify_password": "确认密码", + "verifycode": "验证码", + "view_discount_rules": "查看优惠规则", + "waiting": "等待中", + "warning": "警告", + "wechat": "微信", + "work_order": "工单", + "year": "年", + "you_can_use_the_kubectl_command_directly_from_the_terminal": "您可通过终端直接使用 kubectl 命令", + "you_can_view_fees_through_the_fee_center": "您可通过费用中心查看费用", + "you_have_not_purchased_the_license": "您还没有购买 License", + "yuan": "元" +} \ No newline at end of file diff --git a/frontend/desktop/public/locales/zh/error.json b/frontend/desktop/public/locales/zh/error.json index 8a27e99f186..58dbfcb779b 100644 --- a/frontend/desktop/public/locales/zh/error.json +++ b/frontend/desktop/public/locales/zh/error.json @@ -1,22 +1,22 @@ { -"NOT_SUPPORT": "不支持", -"OAUTH_PROVIDER_NOT_FOUND": "当前绑定的登录方式不存在", -"EXIST_SAME_OAUTH_PROVIDER": "已存在相同的绑定的登录方式", -"USER_NOT_FOUND": "未找到用户", -"RESULT_SUCCESS": "响应成功", -"INTERNAL_SERVER_ERROR": "内部服务器错误", -"INSUFFICENT_BALANCE": "余额不足", -"ACCOUNT_NOT_FOUND": "未找到账户", -"USER_CR_NOT_FOUND": "未找到用户CR", -"OAUTHPROVIDER_NOT_FOUND": "未找到OAuth提供程序", -"PRIVATE_WORKSPACE_NOT_FOUND": "未找到私有工作空间", -"GET_RESOURCE_ERROR": "获取资源错误", -"REMAIN_OTHER_REGION_RESOURCE": "其他可用区残留资源", -"REMAIN_WORKSACE_OWNER": "当前可用区残留工作空间", -"REMAIN_CVM": "当前可用区残留云主机", -"REMAIN_APP": "当前可用区残留应用", -"REMAIN_TEMPLATE": "当前可用区残留模板", -"REMAIN_OBJECT_STORAGE": "当前可用区残留对象存储", -"REMAIN_DATABASE": "当前可用区残留数据库", -"KUBECONFIG_NOT_FOUND": "未找到Kubeconfig" + "NOT_SUPPORT": "不支持", + "OAUTH_PROVIDER_NOT_FOUND": "当前绑定的登录方式不存在", + "EXIST_SAME_OAUTH_PROVIDER": "已存在相同的绑定的登录方式", + "USER_NOT_FOUND": "未找到用户", + "RESULT_SUCCESS": "响应成功", + "INTERNAL_SERVER_ERROR": "内部服务器错误", + "INSUFFICENT_BALANCE": "余额不足", + "ACCOUNT_NOT_FOUND": "未找到账户", + "USER_CR_NOT_FOUND": "未找到用户CR", + "OAUTHPROVIDER_NOT_FOUND": "未找到OAuth提供程序", + "PRIVATE_WORKSPACE_NOT_FOUND": "未找到私有工作空间", + "GET_RESOURCE_ERROR": "获取资源错误", + "REMAIN_OTHER_REGION_RESOURCE": "其他可用区残留资源", + "REMAIN_WORKSACE_OWNER": "当前可用区残留工作空间", + "REMAIN_CVM": "当前可用区残留云主机", + "REMAIN_APP": "当前可用区残留应用", + "REMAIN_TEMPLATE": "当前可用区残留模板", + "REMAIN_OBJECT_STORAGE": "当前可用区残留对象存储", + "REMAIN_DATABASE": "当前可用区残留数据库", + "KUBECONFIG_NOT_FOUND": "未找到Kubeconfig" } \ No newline at end of file diff --git a/frontend/desktop/src/components/AppDock/index.tsx b/frontend/desktop/src/components/AppDock/index.tsx index b8098855a9e..3d00d341ee6 100644 --- a/frontend/desktop/src/components/AppDock/index.tsx +++ b/frontend/desktop/src/components/AppDock/index.tsx @@ -213,7 +213,7 @@ export default function AppDock() { onClick={toggleShape} borderRadius={'4px'} > - {t('Switching Disc')} + {t('common:switching_disc')}
diff --git a/frontend/desktop/src/components/account/AccountCenter/AuthModifyList.tsx b/frontend/desktop/src/components/account/AccountCenter/AuthModifyList.tsx index 93ab1f2532e..53ba96f03dd 100644 --- a/frontend/desktop/src/components/account/AccountCenter/AuthModifyList.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/AuthModifyList.tsx @@ -62,7 +62,7 @@ export function AuthModifyList({ const result = []; if (conf.idp.github.enabled) result.push({ - title: t('Github'), + title: t('common:github'), isBinding: GITHUBIsBinding, actionCb(action: Exclude) { const githubConf = conf.idp.github; @@ -76,7 +76,7 @@ export function AuthModifyList({ if (conf.idp.wechat.enabled) result.push({ - title: t('Wechat'), + title: t('common:wechat'), isBinding: WECHATIsBinding, actionCb(action: Exclude) { const wechatConf = conf.idp.wechat; @@ -89,7 +89,7 @@ export function AuthModifyList({ }); if (conf.idp.google.enabled) result.push({ - title: t('Google'), + title: t('common:google'), isBinding: GOOGLEIsBinding, actionCb(action: Exclude) { const googleConf = conf.idp.google; @@ -124,7 +124,7 @@ export function AuthModifyList({ /> ) : ( - {t('Unbound')} + {t('common:unbound')} )} {(!auth.isBinding || !isOnlyOne) && ( {modifyBehavior === BINDING_STATE_MODIFY_BEHAVIOR.BINDING - ? t('Bind') + ? t('common:bind') : modifyBehavior === BINDING_STATE_MODIFY_BEHAVIOR.UNBINDING - ? t('Unbind') + ? t('common:unbind') : modifyBehavior === BINDING_STATE_MODIFY_BEHAVIOR.CHANGE_BINDING - ? t('Change') + ? t('common:change') : null} ); diff --git a/frontend/desktop/src/components/account/AccountCenter/DeleteAccountModal.tsx b/frontend/desktop/src/components/account/AccountCenter/DeleteAccountModal.tsx index 4b2d652984b..c667a2c1a03 100644 --- a/frontend/desktop/src/components/account/AccountCenter/DeleteAccountModal.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/DeleteAccountModal.tsx @@ -27,6 +27,7 @@ import { SettingInputGroup } from './SettingInputGroup'; import { useRouter } from 'next/router'; import { RESOURCE_STATUS } from '@/types/response/checkResource'; import { deleteUserRequest } from '@/api/auth'; +import { I18nErrorKey } from '@/types/i18next'; enum PageStatus { IDLE, REMAIN_OTHER_REGION_RESOURCE, @@ -39,14 +40,13 @@ enum PageStatus { } export default function DeleteAccount({ ...props }: ButtonProps) { const { onOpen, isOpen, onClose } = useDisclosure(); - const t = useTranslation().t; - const errorT = useTranslation('error').t; + const { t } = useTranslation(); const queryClient = useQueryClient(); const { toast } = useCustomToast({ status: 'error' }); const { delSession, setToken, session } = useSessionStore(); const [pagestatus, setPagestatus] = useState(PageStatus.IDLE); const [nickname, setnickname] = useState(''); - const verifyWords = t('deleteMyAccount'); + const verifyWords = t('common:deletemyaccount'); const router = useRouter(); const [verifyValue, setVerifyValue] = useState(''); const mutation = useMutation({ @@ -76,7 +76,7 @@ export default function DeleteAccount({ ...props }: ButtonProps) { return setPagestatus(PageStatus.REMAIN_WORKSPACE); } else { setPagestatus(PageStatus.IDLE); - toast({ title: errorT(message) }); + toast({ title: t(message as I18nErrorKey, { ns: 'error' }) }); } } }); @@ -95,7 +95,7 @@ export default function DeleteAccount({ ...props }: ButtonProps) { color={'red.600'} {...props} > - {t('Delete Account Button')} + {t('common:delete_account_button')} } @@ -110,7 +110,7 @@ export default function DeleteAccount({ ...props }: ButtonProps) { - {t('Delete Account Title')} + {t('common:delete_account_title')} {mutation.isLoading ? ( @@ -118,7 +118,7 @@ export default function DeleteAccount({ ...props }: ButtonProps) { {pagestatus === PageStatus.IDLE ? ( - {t('DeleteAccountTitle')} + {t('common:deleteaccounttitle')} - {t('IrreversibleActionTips')} + {t('common:irreversibleactiontips')} - {t('Enter')} + {t('common:enter')} {session?.user.name} - {t('Confirm')} + {t('common:confirm')} - {t('Enter')} + {t('common:enter')} {verifyWords} - {t('Confirm')} + {t('common:confirm')} - {t('Cancel')} + {t('common:cancel')} ) : ( {pagestatus === PageStatus.INSUFFICIENT_BALANCE ? ( - {t('INSUFFICIENT_BALANCE_tips')} + {t('common:insufficient_balance_tips')} ) : pagestatus === PageStatus.REMAIN_APP ? ( - {t('Remain App Tips')} + {t('common:remain_app_tips')} ) : pagestatus === PageStatus.REMAIN_TEMPLATE ? ( - {t('Remain Template Tips')} + {t('common:remain_template_tips')} ) : pagestatus === PageStatus.REMAIN_OBJECT_STORAGE ? ( - {t('Remain ObjectStorage Tips')} + {t('common:remain_objectstorage_tips')} ) : pagestatus === PageStatus.REMAIN_DATABASE ? ( - {t('Remain Database Tips')} + {t('common:remain_database_tips')} ) : pagestatus === PageStatus.REMAIN_WORKSPACE ? ( - {t('Remain Workspace Tips')} + {t('common:remain_workspace_tips')} ) : pagestatus === PageStatus.REMAIN_OTHER_REGION_RESOURCE ? ( - {t('Remain Other Region Resource Tips')} + {t('common:remain_other_region_resource_tips')} ) : null} {t('Delete Account Caution')} + {t('common:delete_account_caution')} )} @@ -233,10 +233,10 @@ export default function DeleteAccount({ ...props }: ButtonProps) { color={'grayModern.600'} {...props} > - {t('Cancel')} + {t('common:cancel')} diff --git a/frontend/desktop/src/components/account/AccountCenter/PasswordModify.tsx b/frontend/desktop/src/components/account/AccountCenter/PasswordModify.tsx index c5ee714f6e9..684525a8ed9 100644 --- a/frontend/desktop/src/components/account/AccountCenter/PasswordModify.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/PasswordModify.tsx @@ -34,7 +34,7 @@ export default function PasswordModify( if (data.code === 200) { toast({ status: 'success', - title: t('passwordChangeSuccess') + title: t('common:passwordchangesuccess') }); reset(); props.onClose?.(); @@ -55,9 +55,9 @@ export default function PasswordModify( mutation.mutate({ oldPassword, newPassword }); }, (errors) => { - if (errors.oldPassword) return toast({ title: t('currentPasswordRequired') }); - if (errors.newPassword) return toast({ title: t('password tips') }); - if (errors.againPassword) return toast({ title: t('passwordMismatch') }); + if (errors.oldPassword) return toast({ title: t('common:currentpasswordrequired') }); + if (errors.newPassword) return toast({ title: t('common:password_tips') }); + if (errors.againPassword) return toast({ title: t('common:password_mis_match') }); } )} > @@ -71,7 +71,7 @@ export default function PasswordModify( > - {t('currentPassword')} + {t('common:currentpassword')} - {t('newPassword')} + {t('common:newpassword')} - {t('confirmNewPassword')} + {t('common:confirmnewpassword')} diff --git a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx index 5c5e20919f7..7c0720114fd 100644 --- a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsBind.tsx @@ -48,14 +48,14 @@ const smsBindGen = (smsType: SmsType) => startTimer(); toast({ status: 'success', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); }, onError(err) { getCodeMutation.reset(); toast({ status: 'error', - title: t('Get code failed') + title: t('common:get_code_failed') }); } }); @@ -65,14 +65,14 @@ const smsBindGen = (smsType: SmsType) => if (isRunning) { toast({ status: 'error', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); return; } if (!(await trigger('id'))) { toast({ status: 'error', - title: smsType === 'phone' ? t('Invalid phone number') : t('Invalid Email') + title: smsType === 'phone' ? t('common:invalid_phone_number') : t('common:invalid_email') }); return; } @@ -92,7 +92,7 @@ const smsBindGen = (smsType: SmsType) => if (data.code === 200) { toast({ status: 'success', - title: t('Bind Success') + title: t('common:bind_success') }); reset(); await queryClient.invalidateQueries(); @@ -132,10 +132,10 @@ const smsBindGen = (smsType: SmsType) => }, (errors) => { if (errors.id) { - if (smsType === 'email') return toast({ title: t('Invalid Email') }); - else return toast({ title: t('Invalid phone number') }); + if (smsType === 'email') return toast({ title: t('common:invalid_email') }); + else return toast({ title: t('common:invalid_phone_number') }); } - if (errors.verifyCode) return toast({ title: t('verify code tips') }); + if (errors.verifyCode) return toast({ title: t('common:verify_code_tips') }); } )} > @@ -149,7 +149,7 @@ const smsBindGen = (smsType: SmsType) => > - {smsType === 'phone' ? t('Phone') : t('Email')} + {smsType === 'phone' ? t('common:phone') : t('common:email')} fontSize={'11px'} w={'60px'} > - {t('Get Code')} + {t('common:get_code')} } @@ -175,7 +175,7 @@ const smsBindGen = (smsType: SmsType) => - {t('verifyCode')} + {t('common:verifycode')} diff --git a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsChange.tsx b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsChange.tsx index 9b626bdfe7d..e5e68b0af50 100644 --- a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsChange.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsChange.tsx @@ -55,14 +55,14 @@ function OldSms({ smsType, onSuccess }: { smsType: SmsType; onSuccess?: (uid: st startTimer(); toast({ status: 'success', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); }, onError(err) { getCodeMutation.reset(); toast({ status: 'error', - title: t('Get code failed') + title: t('common:get_code_failed') }); } }); @@ -72,14 +72,14 @@ function OldSms({ smsType, onSuccess }: { smsType: SmsType; onSuccess?: (uid: st if (isRunning) { toast({ status: 'error', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); return; } if (!(await trigger('id'))) { toast({ status: 'error', - title: t('Get code failed') + title: t('common:get_code_failed') }); return; } @@ -116,10 +116,10 @@ function OldSms({ smsType, onSuccess }: { smsType: SmsType; onSuccess?: (uid: st }, (errors) => { if (errors.id) { - if (smsType === 'phone') return toast({ title: t('Invalid phone number') }); - else return toast({ title: t('Invalid Email') }); + if (smsType === 'phone') return toast({ title: t('common:invalid_phone_number') }); + else return toast({ title: t('common:invalid_email') }); } - if (errors.verifyCode) return toast({ title: t('verify code tips') }); + if (errors.verifyCode) return toast({ title: t('common:verify_code_tips') }); } )} > @@ -134,7 +134,7 @@ function OldSms({ smsType, onSuccess }: { smsType: SmsType; onSuccess?: (uid: st - {smsType === 'phone' ? t('Old Phone') : t('Old Email')} + {smsType === 'phone' ? t('common:old_phone') : t('common:old_email')} - {t('Get Code')} + {t('common:get_code')} } @@ -161,7 +161,7 @@ function OldSms({ smsType, onSuccess }: { smsType: SmsType; onSuccess?: (uid: st - {t('verifyCode')} + {t('common:verifycode')} @@ -216,14 +216,14 @@ function NewSms({ startTimer(); toast({ status: 'success', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); }, onError(err) { getCodeMutation.reset(); toast({ status: 'error', - title: t('Get code failed') + title: t('common:get_code_failed') }); } }); @@ -233,14 +233,14 @@ function NewSms({ if (isRunning) { toast({ status: 'error', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); return; } if (!(await trigger('id'))) { toast({ status: 'error', - title: smsType === 'phone' ? t('Invalid phone number') : t('Invalid Email') + title: smsType === 'phone' ? t('common:invalid_phone_number') : t('common:invalid_email') }); return; } @@ -256,7 +256,7 @@ function NewSms({ if (data.code === 200) { toast({ status: 'success', - title: smsType === 'phone' ? t('phoneChangeSuccess') : t('emailChangeSuccess') + title: smsType === 'phone' ? t('common:phonechangesuccess') : t('common:emailchangesuccess') }); reset(); onClose?.(); @@ -292,10 +292,10 @@ function NewSms({ }, (errors) => { if (errors.id) { - if (smsType === 'phone') return toast({ title: t('Invalid phone number') }); - else return toast({ title: t('Invalid Email') }); + if (smsType === 'phone') return toast({ title: t('common:invalid_phone_number') }); + else return toast({ title: t('common:invalid_email') }); } - if (errors.verifyCode) return toast({ title: t('verify code tips') }); + if (errors.verifyCode) return toast({ title: t('common:verify_code_tips') }); } )} > @@ -310,7 +310,7 @@ function NewSms({ - {smsType === 'phone' ? t('New Phone') : t('New Email')} + {smsType === 'phone' ? t('common:new_phone') : t('common:new_email')} - {t('Get Code')} + {t('common:get_code')} } @@ -337,7 +337,7 @@ function NewSms({ - {t('verifyCode')} + {t('common:verifycode')} diff --git a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsUnbind.tsx b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsUnbind.tsx index 94bffad0228..56c685c6666 100644 --- a/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsUnbind.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/SmsModify/SmsUnbind.tsx @@ -45,14 +45,14 @@ const smsUnBindGen = (smsType: SmsType) => startTimer(); toast({ status: 'success', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); }, onError(err) { getCodeMutation.reset(); toast({ status: 'error', - title: t('Get code failed') + title: t('common:get_code_failed') }); } }); @@ -62,14 +62,14 @@ const smsUnBindGen = (smsType: SmsType) => if (isRunning) { toast({ status: 'error', - title: t('Already Sent Code') + title: t('common:already_sent_code') }); return; } if (!(await trigger('id'))) { toast({ status: 'error', - title: t('Get code failed') + title: t('common:get_code_failed') }); return; } @@ -88,7 +88,7 @@ const smsUnBindGen = (smsType: SmsType) => if (data.code === 200) { toast({ status: 'success', - title: t('Unbind Success') + title: t('common:unbind_success') }); reset(); await queryClient.invalidateQueries(); @@ -115,10 +115,10 @@ const smsUnBindGen = (smsType: SmsType) => }, (errors) => { if (errors.id) { - if (smsType === 'email') return toast({ title: t('Invalid Email') }); - else return toast({ title: t('Invalid phone number') }); + if (smsType === 'email') return toast({ title: t('common:invalid_email') }); + else return toast({ title: t('common:invalid_phone_number') }); } - if (errors.verifyCode) return toast({ title: t('verify code tips') }); + if (errors.verifyCode) return toast({ title: t('common:verify_code_tips') }); } )} > @@ -132,7 +132,7 @@ const smsUnBindGen = (smsType: SmsType) => > - {smsType === 'phone' ? t('Phone') : t('Email')} + {smsType === 'phone' ? t('common:phone') : t('common:email')} fontSize={'11px'} w={'60px'} > - {t('Get Code')} + {t('common:get_code')} } @@ -158,7 +158,7 @@ const smsUnBindGen = (smsType: SmsType) => - {t('verifyCode')} + {t('common:verifycode')} diff --git a/frontend/desktop/src/components/account/AccountCenter/index.tsx b/frontend/desktop/src/components/account/AccountCenter/index.tsx index 66183b34e9a..4e47ff1515b 100644 --- a/frontend/desktop/src/components/account/AccountCenter/index.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/index.tsx @@ -71,11 +71,11 @@ export default function Index(props: Omit) { infoData.refetch(); }; const modalTitle = useMemo(() => { - if (pageState === PageState.INDEX) return t('Account Settings'); - else if (pageState === PageState.PASSWORD) return t('changePassword'); + if (pageState === PageState.INDEX) return t('common:account_settings'); + else if (pageState === PageState.PASSWORD) return t('common:changepassword'); else if (Object.values(PhoneState).includes(pageState as PhoneState)) - return t('changePhone'); // bind or unbind - else if (Object.values(EmailState).includes(pageState as EmailState)) return t('changeEmail'); + return t('common:changephone'); // bind or unbind + else if (Object.values(EmailState).includes(pageState as EmailState)) return t('common:changeemail'); else return ''; }, [t, pageState]); const queryClient = useQueryClient(); @@ -187,7 +187,7 @@ export default function Index(props: Omit) { > {/* */} - {t('Avatar')} + {t('common:avatar')}
) { - {t('Nickname')} + {t('common:nickname')} {infoData.data.nickname} @@ -211,7 +211,7 @@ export default function Index(props: Omit) { {providerState.PASSWORD.isBinding && ( {t('Password')}} + LeftElement={{t('common:password')}} RightElement={ <> ********* @@ -226,13 +226,13 @@ export default function Index(props: Omit) { /> )} {t('Phone')}} + LeftElement={{t('common:phone')}} RightElement={ <> {providerState.PHONE.isBinding ? providerState.PHONE.id.replace(/(\d{3})\d+(\d{4})/, '$1****$2') - : t('Unbound')} + : t('common:unbound')} ) { } /> {t('Email')}} + LeftElement={{t('common:email')}} RightElement={ <> {providerState.EMAIL.isBinding ? providerState.EMAIL.id.replace(/(\d{3})\d+(\d{4})/, '$1****$2') - : t('Unbound')} + : t('common:unbound')} ) { WECHATIsBinding={providerState.WECHAT.isBinding} /> {t('Delete account')}} + LeftElement={{t('common:delete_account')}} RightElement={ <> - {t('Delete Account Tips')} + {t('common:delete_account_tips')} } diff --git a/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx b/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx index 1d25913c988..f857b25834e 100644 --- a/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx +++ b/frontend/desktop/src/components/account/AccountCenter/mergeUser/NeedToMergeModal.tsx @@ -21,6 +21,7 @@ import useCallbackStore, { MergeUserStatus } from '@/stores/callback'; import { useEffect, useState } from 'react'; import { USER_MERGE_STATUS } from '@/types/response/merge'; import { ValueOf } from '@/types'; +import { I18nErrorKey } from '@/types/i18next'; function NeedToMerge({ ...props }: BoxProps & {}) { const { mergeUserStatus, mergeUserData, setMergeUserStatus, setMergeUserData } = @@ -32,7 +33,6 @@ function NeedToMerge({ ...props }: BoxProps & {}) { }; const { t } = useTranslation(); - const errorT = useTranslation('error').t; const queryClient = useQueryClient(); const { toast } = useCustomToast({ status: 'error' }); const mutation = useMutation({ @@ -43,7 +43,7 @@ function NeedToMerge({ ...props }: BoxProps & {}) { onError(err: { message: ValueOf }) { toast({ status: 'error', - title: errorT(err.message) + title: t(err.message as I18nErrorKey, { ns: 'error' }) }); }, onSettled() { @@ -74,7 +74,7 @@ function NeedToMerge({ ...props }: BoxProps & {}) { gap={'10px'} > - {t('Merge Account Title')} + {t('common:merge_account_title')} {mutation.isLoading ? ( @@ -83,8 +83,8 @@ function NeedToMerge({ ...props }: BoxProps & {}) { {mergeUserStatus === MergeUserStatus.CONFLICT - ? t('MergeAccountTips1') - : t('DeleteAccountTips2')} + ? t('common:mergeaccounttips1') + : t('common:delete_account_tips2')} {mergeUserStatus === MergeUserStatus.CONFLICT ? ( @@ -98,7 +98,7 @@ function NeedToMerge({ ...props }: BoxProps & {}) { fontWeight={'500'} color={'grayModern.600'} > - {t('Confirm')} + {t('common:confirm')} ) : ( @@ -113,7 +113,7 @@ function NeedToMerge({ ...props }: BoxProps & {}) { fontWeight={'500'} color={'grayModern.600'} > - {t('Cancel')} + {t('common:cancel')} )} diff --git a/frontend/desktop/src/components/account/cost.tsx b/frontend/desktop/src/components/account/cost.tsx index 8257e8b3bfa..fd4ce149749 100644 --- a/frontend/desktop/src/components/account/cost.tsx +++ b/frontend/desktop/src/components/account/cost.tsx @@ -102,7 +102,7 @@ export default function Cost() { > - {t('Balance')} + {t('common:balance')} @@ -126,7 +126,7 @@ export default function Cost() { color={'rgba(255, 255, 255, 0.90)'} cursor={'pointer'} > - {t('Charge')} + {t('common:charge')}
)}
@@ -140,16 +140,16 @@ export default function Cost() { > - {t('Expected used')} + {t('common:expected_used')} {calculations.estimatedDaysUsable === Number.POSITIVE_INFINITY ? ( <> - {t('Day')} + {t('common:day')} ) : ( <> - {calculations.estimatedDaysUsable} {t('Day')} + {calculations.estimatedDaysUsable} {t('common:day')} )} @@ -168,7 +168,7 @@ export default function Cost() { borderRadius={'2px'} > - {t('Used last month')} + {t('common:used_last_month')} {formatMoney(calculations.prevMonthAmount).toFixed(2)} @@ -184,7 +184,7 @@ export default function Cost() { borderRadius={'2px'} > - {t('Expected to use next month')} + {t('common:expected_to_use_next_month')} {formatMoney(calculations.estimatedNextMonthAmount).toFixed(2)} @@ -206,7 +206,7 @@ export default function Cost() { > - {t('Monitor')} + {t('common:monitor')} @@ -217,18 +217,6 @@ export default function Cost() { )} - - {/* */} ); } diff --git a/frontend/desktop/src/components/account/index.tsx b/frontend/desktop/src/components/account/index.tsx index b3381c4ea2b..5f7b55e24b7 100644 --- a/frontend/desktop/src/components/account/index.tsx +++ b/frontend/desktop/src/components/account/index.tsx @@ -112,7 +112,7 @@ export default function Account() { > - {t('Log Out')} + {t('common:log_out')} @@ -149,7 +149,7 @@ export default function Account() { py={'12px'} px={'16px'} > - {t('Account Settings')} + {t('common:account_settings')} )} @@ -164,7 +164,7 @@ export default function Account() { py={'12px'} px={'16px'} > - {t('Work Order')} + {t('common:work_order')} {wnapp?.i18n?.[i18n?.language]?.name ? wnapp.i18n?.[i18n?.language]?.name - : t(wnapp?.name)} + : wnapp?.name} {wnapp.menuData?.helpDocs && ( - {t('Doc')} + {t('common:doc')} )} diff --git a/frontend/desktop/src/components/desktop_content/apps.tsx b/frontend/desktop/src/components/desktop_content/apps.tsx index 4e35b8edc7b..6568f1724af 100644 --- a/frontend/desktop/src/components/desktop_content/apps.tsx +++ b/frontend/desktop/src/components/desktop_content/apps.tsx @@ -85,7 +85,7 @@ export default function Apps() { zIndex={1} > - {t('All Apps')} + {t('common:all_apps')} {totalPages !== 1 && ( @@ -152,7 +152,7 @@ export default function Apps() { > {item?.i18n?.[i18n?.language]?.name ? item?.i18n?.[i18n?.language]?.name - : t(item?.name)} + : item?.name} ))} diff --git a/frontend/desktop/src/components/desktop_content/assistant.tsx b/frontend/desktop/src/components/desktop_content/assistant.tsx index f3e2798664a..21d2a3d7938 100644 --- a/frontend/desktop/src/components/desktop_content/assistant.tsx +++ b/frontend/desktop/src/components/desktop_content/assistant.tsx @@ -22,7 +22,7 @@ export default function Assistant() { gap={'8px'} onClick={() => { message({ - title: t('Under active development') + title: t('common:under_active_development') }); }} > @@ -47,7 +47,7 @@ export default function Assistant() { 🤖 - {t('Sealos Copilot')} + {t('common:sealos_copilot')} ); } diff --git a/frontend/desktop/src/components/desktop_content/monitor.tsx b/frontend/desktop/src/components/desktop_content/monitor.tsx index 4876320f17d..c497d8688a2 100644 --- a/frontend/desktop/src/components/desktop_content/monitor.tsx +++ b/frontend/desktop/src/components/desktop_content/monitor.tsx @@ -20,19 +20,19 @@ export default function Monitor({ needStyles = true }: { needStyles?: boolean }) unit: 'C' }, { - label: t('Memory'), + label: t('common:memory'), value: data?.data?.totalMemory, icon: , unit: 'GB' }, { - label: t('Storage'), + label: t('common:storage'), value: data?.data?.totalStorage, icon: , unit: 'GB' }, { - label: t('Flow'), + label: t('common:flow'), value: `~`, icon: , unit: 'GB' @@ -57,7 +57,7 @@ export default function Monitor({ needStyles = true }: { needStyles?: boolean }) - {t('Monitor')} + {t('common:monitor')} )} @@ -81,16 +81,16 @@ export default function Monitor({ needStyles = true }: { needStyles?: boolean }) > - {t('Healthy Pod', { count: runningPodCount })} + {t('common:healthy_pod', { count: runningPodCount })} - {t('Alarm Pod', { count: totalPodCount - runningPodCount })} + {t('common:alarm_pod', { count: totalPodCount - runningPodCount })} - {t('Used Resources')} + {t('common:used_resources')} {info.map((item) => ( diff --git a/frontend/desktop/src/components/desktop_content/searchBox.tsx b/frontend/desktop/src/components/desktop_content/searchBox.tsx index caba7042e99..f897bc68772 100644 --- a/frontend/desktop/src/components/desktop_content/searchBox.tsx +++ b/frontend/desktop/src/components/desktop_content/searchBox.tsx @@ -60,7 +60,7 @@ export default function SearchBox() { w={'full'} outline={'none'} type="text" - placeholder={t('Search Apps') || 'Search Apps'} + placeholder={t('common:search_apps') || 'Search Apps'} bg={'transparent'} outlineOffset={''} border={'none'} @@ -125,9 +125,7 @@ export default function SearchBox() { /> - {app?.i18n?.[i18n?.language]?.name - ? app?.i18n?.[i18n?.language]?.name - : t(app?.name)} + {app?.i18n?.[i18n?.language]?.name ? app?.i18n?.[i18n?.language]?.name : app?.name} )) ) : ( @@ -137,7 +135,7 @@ export default function SearchBox() { fontWeight={500} color={'rgba(255, 255, 255, 0.90)'} > - {t('No Apps Found') || 'No Apps Found'} + {t('common:no_apps_found') || 'No Apps Found'} )} diff --git a/frontend/desktop/src/components/desktop_content/warn.tsx b/frontend/desktop/src/components/desktop_content/warn.tsx index 722b27a0154..aeb4bd32e5b 100644 --- a/frontend/desktop/src/components/desktop_content/warn.tsx +++ b/frontend/desktop/src/components/desktop_content/warn.tsx @@ -19,7 +19,7 @@ export default function Warn() { - {t('Alerts')} + {t('common:alerts')}
diff --git a/frontend/desktop/src/components/floating_button/index.tsx b/frontend/desktop/src/components/floating_button/index.tsx index 532f012e9b4..d4168457e4a 100644 --- a/frontend/desktop/src/components/floating_button/index.tsx +++ b/frontend/desktop/src/components/floating_button/index.tsx @@ -323,7 +323,7 @@ export default function FloatingButton() { onClick={toggleShape} borderRadius={'4px'} > - {t('Toggle App Bar')} + {t('common:toggle_app_bar')}
diff --git a/frontend/desktop/src/components/more_apps/index.tsx b/frontend/desktop/src/components/more_apps/index.tsx index efb7a7eb271..3d4249df618 100644 --- a/frontend/desktop/src/components/more_apps/index.tsx +++ b/frontend/desktop/src/components/more_apps/index.tsx @@ -44,7 +44,7 @@ export default function Index() { textShadow={'0px 1px 2px rgba(0, 0, 0, 0.4)'} lineHeight={'140%'} > - {t('More Apps')} + {t('common:more_apps')} @@ -120,7 +120,7 @@ export default function Index() { > {item?.i18n?.[i18n?.language]?.name ? item?.i18n?.[i18n?.language]?.name - : t(item?.name)} + : item?.name} ))} diff --git a/frontend/desktop/src/components/more_button/index.tsx b/frontend/desktop/src/components/more_button/index.tsx index 036da34cb83..802bba4a545 100644 --- a/frontend/desktop/src/components/more_button/index.tsx +++ b/frontend/desktop/src/components/more_button/index.tsx @@ -29,7 +29,7 @@ export default function MoreButton() { - {t('More Apps')} + {t('common:more_apps')} ); diff --git a/frontend/desktop/src/components/notification/index.tsx b/frontend/desktop/src/components/notification/index.tsx index 782936f16d8..8c585383bf7 100644 --- a/frontend/desktop/src/components/notification/index.tsx +++ b/frontend/desktop/src/components/notification/index.tsx @@ -177,7 +177,7 @@ export default function Notification(props: TNotification) { {MessageConfig.activePage === 'index' - ? t('Message Center') + ? t('common:message_center') : i18n.language === 'zh' && MessageConfig.msgDetail?.spec?.i18ns?.zh?.title ? MessageConfig.msgDetail?.spec?.i18ns?.zh?.title : MessageConfig.msgDetail?.spec?.title} @@ -196,7 +196,7 @@ export default function Notification(props: TNotification) { ) } > - {t('Unread')} ({unReadNotes?.length || 0}) + {t('common:unread')} ({unReadNotes?.length || 0}) - {t('Have Read')} + {t('common:have_read')} @@ -248,7 +248,7 @@ export default function Notification(props: TNotification) { className={clsx(styles.desc, styles.footer)} > - {t('From')}「 + {t('common:from')}「 {i18n.language === 'zh' && item.spec?.i18ns?.zh?.from ? item.spec?.i18ns?.zh?.from : item?.spec?.from} @@ -279,7 +279,7 @@ export default function Notification(props: TNotification) { fontWeight="400" > - {t('From')}「 + {t('common:from')}「 {i18n.language === 'zh' && MessageConfig.msgDetail?.spec?.i18ns?.zh?.from ? MessageConfig.msgDetail?.spec?.i18ns?.zh?.from : MessageConfig.msgDetail?.spec?.from} @@ -320,7 +320,7 @@ export default function Notification(props: TNotification) { handleCharge(); }} > - {t('Charge')} + {t('common:charge')} )} @@ -403,7 +403,7 @@ export default function Notification(props: TNotification) { disclosure.onOpen(); }} > - {t('Detail')} + {t('common:detail')} diff --git a/frontend/desktop/src/components/region/RegionToggle.tsx b/frontend/desktop/src/components/region/RegionToggle.tsx index cb3d4f62eb4..ff8b1e47fec 100644 --- a/frontend/desktop/src/components/region/RegionToggle.tsx +++ b/frontend/desktop/src/components/region/RegionToggle.tsx @@ -11,12 +11,12 @@ import { useTranslation } from 'next-i18next'; import { useRouter } from 'next/router'; import { useMemo } from 'react'; import { DesktopExchangeIcon, ZoneIcon } from '../icons'; +import { I18nCloudProvidersKey } from '@/types/i18next'; export default function RegionToggle() { const disclosure = useDisclosure(); const { setWorkSpaceId, session } = useSessionStore(); const { t, i18n } = useTranslation(); - const { t: providerT } = useTranslation('cloudProviders'); const router = useRouter(); const { data, isSuccess } = useQuery(['regionlist'], getRegionList); const regionList = useMemo(() => data?.data?.regionList || [], [data]); @@ -68,7 +68,10 @@ export default function RegionToggle() { > - {providerT(curRegion?.location || '')} {curRegion?.description?.serial} + {t((curRegion?.location as I18nCloudProvidersKey) || 'beijing', { + ns: 'cloudProviders' + })} + {curRegion?.description?.serial} @@ -129,12 +132,13 @@ export default function RegionToggle() { mb={'12px'} > - {providerT(region?.location)} {region?.description?.serial} + {t(region?.location as I18nCloudProvidersKey, { ns: 'cloudProviders' })} + {region?.description?.serial} {cpuPrice && ( - {cpuPrice?.name} {cpuPrice?.unit_price || 0} {t('Yuan')}/{t('Core')}/ - {t('Year')} + {cpuPrice?.name} {cpuPrice?.unit_price || 0} {t('common:yuan')}/ + {t('common:core')}/{t('common:year')} )} @@ -142,14 +146,16 @@ export default function RegionToggle() { - {providerT('Provider')} + {t('cloudProviders:provider')} - {providerT(region?.description?.provider)} + {t(region?.description?.provider as I18nCloudProvidersKey, { + ns: 'cloudProviders' + })} - {t('Description')} + {t('common:description')} {region?.description?.description?.[i18n.language as 'zh' | 'en']} diff --git a/frontend/desktop/src/components/rightContext/index.tsx b/frontend/desktop/src/components/rightContext/index.tsx index 8d67283aa08..e2e253a2c30 100644 --- a/frontend/desktop/src/components/rightContext/index.tsx +++ b/frontend/desktop/src/components/rightContext/index.tsx @@ -1,5 +1,4 @@ import { Box, Flex, Icon, Text } from '@chakra-ui/react'; -import { useTranslation } from 'next-i18next'; import { MouseEvent, ReactElement, ReactNode, useState } from 'react'; export type SideBarMenu = { @@ -12,7 +11,6 @@ export type SideBarMenu = { export default function RightContext({ children }: { children: ReactNode }) { const [contextOpen, setContextOpen] = useState(false); const [xYPosistion, setXyPosistion] = useState({ x: 0, y: 0 }); - const { t } = useTranslation(); const showNav = (e: MouseEvent) => { e.preventDefault(); @@ -79,7 +77,7 @@ export default function RightContext({ children }: { children: ReactNode }) { {item.icon} - {t(item.value)} + {item.value} ); })} diff --git a/frontend/desktop/src/components/signin/auth/useCustomError.tsx b/frontend/desktop/src/components/signin/auth/useCustomError.tsx index 6dc5b7ad578..c5ea4aa8864 100644 --- a/frontend/desktop/src/components/signin/auth/useCustomError.tsx +++ b/frontend/desktop/src/components/signin/auth/useCustomError.tsx @@ -3,20 +3,21 @@ import React, { useState, useEffect } from 'react'; import warnIcon from 'public/icons/warning.svg'; import closeIcon from 'public/icons/close_white.svg'; import { useTranslation } from 'next-i18next'; +import { I18nCommonKey } from '@/types/i18next'; const useCustomError = () => { const { t } = useTranslation(); - const [error, setError] = useState(''); + const [error, setError] = useState(); - const showError = (errorMessage: string, duration = 5000) => { + const showError = (errorMessage: I18nCommonKey, duration = 5000) => { setError(errorMessage); setTimeout(() => { - setError(''); + setError(null); }, duration); }; const closeError = () => { - setError(''); + setError(null); }; const ErrorComponent = () => { diff --git a/frontend/desktop/src/components/signin/auth/usePassword.tsx b/frontend/desktop/src/components/signin/auth/usePassword.tsx index 255d051f5f6..8de42c00193 100644 --- a/frontend/desktop/src/components/signin/auth/usePassword.tsx +++ b/frontend/desktop/src/components/signin/auth/usePassword.tsx @@ -9,11 +9,12 @@ import { useForm } from 'react-hook-form'; import { jwtDecode } from 'jwt-decode'; import { AccessTokenPayload } from '@/types/token'; import { getInviterId, sessionConfig } from '@/utils/sessionConfig'; +import { I18nCommonKey } from '@/types/i18next'; export default function usePassword({ showError }: { - showError: (errorMessage: string, duration?: number) => void; + showError: (errorMessage: I18nCommonKey, duration?: number) => void; }) { const { t } = useTranslation(); const router = useRouter(); @@ -31,8 +32,8 @@ export default function usePassword({ }>(); const login = async () => { - const deepSearch = (obj: any): string => { - if (!obj || typeof obj !== 'object') return t('Submit Error'); + const deepSearch = (obj: any): I18nCommonKey => { + if (!obj || typeof obj !== 'object') return 'submit_error'; if (!!obj.message) { return obj.message; } @@ -63,7 +64,7 @@ export default function usePassword({ setPageState(1); if (!!data?.confimPassword) { if (data?.password !== data?.confimPassword) { - showError('password not match'); + showError('password_mis_match'); } else { const regionResult = await passwordLoginRequest({ user: data.username, @@ -96,7 +97,7 @@ export default function usePassword({ } } catch (error: any) { console.log(error); - showError(t('Invalid username or password')); + showError(t('common:invalid_username_or_password')); } finally { setIsLoading(false); } @@ -136,7 +137,7 @@ export default function usePassword({ setPageState(0)} /> - {t('Verify password')} + {t('common:verify_password')} - {t('agree policy')} + {t('common:agree_policy')} - {t('Service Agreement')} + {t('common:service_agreement')} - {t('and')} + {t('common:and')} - {t('Privacy Policy')} + {t('common:privacy_policy')} diff --git a/frontend/desktop/src/components/signin/auth/useSms.tsx b/frontend/desktop/src/components/signin/auth/useSms.tsx index 6f9401695f7..c03ea842be2 100644 --- a/frontend/desktop/src/components/signin/auth/useSms.tsx +++ b/frontend/desktop/src/components/signin/auth/useSms.tsx @@ -20,11 +20,12 @@ import { jwtDecode } from 'jwt-decode'; import { uploadConvertData } from '@/api/platform'; import { AccessTokenPayload } from '@/types/token'; import { getInviterId, sessionConfig } from '@/utils/sessionConfig'; +import { I18nCommonKey } from '@/types/i18next'; export default function useSms({ showError }: { - showError: (errorMessage: string, duration?: number) => void; + showError: (errorMessage: I18nCommonKey, duration?: number) => void; }) { const { t } = useTranslation(); const _remainTime = useRef(0); @@ -38,8 +39,8 @@ export default function useSms({ }>(); const login = async () => { - const deepSearch = (obj: any): string => { - if (!obj || typeof obj !== 'object') return t('Submit Error'); + const deepSearch = (obj: any): I18nCommonKey => { + if (!obj || typeof obj !== 'object') return 'submit_error'; if (!!obj.message) { return obj.message; } @@ -75,7 +76,7 @@ export default function useSms({ await router.replace('/'); } } catch (error) { - showError(t('Invalid verification code') || 'Invalid verification code'); + showError(t('common:invalid_verification_code') || 'Invalid verification code'); } finally { setIsLoading(false); } @@ -107,7 +108,7 @@ export default function useSms({ e.preventDefault(); if (!(await trigger('phoneNumber'))) { - showError(t('Invalid phone number') || 'Invalid phone number'); + showError(t('common:invalid_phone_number') || 'Invalid phone number'); return; } setRemainTime(60); @@ -123,7 +124,7 @@ export default function useSms({ throw new Error('Get code failed'); } } catch (err) { - showError(t('Get code failed') || 'Get code failed'); + showError(t('common:get_code_failed') || 'Get code failed'); setRemainTime(0); _remainTime.current = 0; } finally { @@ -152,7 +153,7 @@ export default function useSms({ {remainTime <= 0 ? ( - {t('Get Code')} + {t('common:get_code')} ) : ( {remainTime} s @@ -202,7 +203,7 @@ export default function useSms({ - {t('Verification Code Login')} + {t('common:verification_code_login')} - {t('Password Login')} + {t('common:password_login')} {conf.authConfig?.idp.wechat.enabled && ( - {t('Official account login')} + {t('common:official_account_login')} )} @@ -243,7 +243,9 @@ export default function SigninComponent() { p="10px" onClick={handleLogin} > - {isLoading ? (t('Loading') || 'Loading') + '...' : t('Log In') || 'Log In'} + {isLoading + ? (t('common:loading') || 'Loading') + '...' + : t('common:log_in') || 'Log In'} diff --git a/frontend/desktop/src/components/team/Abdication.tsx b/frontend/desktop/src/components/team/Abdication.tsx index 711a58a25f1..14d82b064c6 100644 --- a/frontend/desktop/src/components/team/Abdication.tsx +++ b/frontend/desktop/src/components/team/Abdication.tsx @@ -81,7 +81,7 @@ export default function Abdication({ {...props} > - {t('Abdication')} + {t('common:abdication')} @@ -94,7 +94,7 @@ export default function Abdication({ > - {t('Abdication')} + {t('common:abdication')} {mutation.isLoading ? ( @@ -170,7 +170,7 @@ export default function Abdication({ submit(); }} > - {t('Confirm')} + {t('common:confirm')} )} diff --git a/frontend/desktop/src/components/team/CreateTeam.tsx b/frontend/desktop/src/components/team/CreateTeam.tsx index 7898fc3db92..7feb54cfe11 100644 --- a/frontend/desktop/src/components/team/CreateTeam.tsx +++ b/frontend/desktop/src/components/team/CreateTeam.tsx @@ -58,7 +58,7 @@ export default function CreateTeam({ textButton = false }: { textButton?: boolea leftIcon={} iconSpacing={'8px'} > - {t('Create Team')} + {t('common:create_team')} ) : ( - {t('Create Team')} + {t('common:create_team')} {mutation.isLoading ? ( @@ -96,7 +96,7 @@ export default function CreateTeam({ textButton = false }: { textButton?: boolea e.preventDefault(); setTeamName(e.target.value); }} - placeholder={t('Name of Team') || ''} + placeholder={t('common:name_of_team') || ''} value={teamName} /> diff --git a/frontend/desktop/src/components/team/DissolveTeam.tsx b/frontend/desktop/src/components/team/DissolveTeam.tsx index 84d05a883e8..0843eab2a18 100644 --- a/frontend/desktop/src/components/team/DissolveTeam.tsx +++ b/frontend/desktop/src/components/team/DissolveTeam.tsx @@ -56,7 +56,7 @@ export default function DissolveTeam({ const submit = () => { if (teamName.trim() !== nsid) return toast({ - title: t('Invaild Name of Team') + title: t('common:invaild_name_of_team') }); mutation.mutate({ ns_uid }); }; @@ -76,13 +76,13 @@ export default function DissolveTeam({ onClick={() => { if (session?.user?.ns_uid === ns_uid) { return toast({ - title: t('Invaild Context') + title: t('common:invaild_context') }); } onOpen(); }} > - {t('Dissolve Team')} + {t('common:dissolve_team')} @@ -101,14 +101,14 @@ export default function DissolveTeam({ ) : ( - {t('Dissovle Tips')} - {t(`Enter Confirm.`, { value: nsid })} + {t('common:dissovle_tips')} + {t(`common:enter_confirm`, { value: nsid })} { e.preventDefault(); setTeamName(e.target.value); }} - placeholder={t('Name of Team') || ''} + placeholder={t('common:name_of_team') || ''} value={teamName} /> )} diff --git a/frontend/desktop/src/components/team/InviteMember.tsx b/frontend/desktop/src/components/team/InviteMember.tsx index 0e39fa40cce..f2992427d02 100644 --- a/frontend/desktop/src/components/team/InviteMember.tsx +++ b/frontend/desktop/src/components/team/InviteMember.tsx @@ -71,7 +71,7 @@ export default function InviteMember({ onError() { toast({ status: 'error', - title: t('Failed to generate invitation link'), + title: t('common:failed_to_generate_invitation_link'), isClosable: true, position: 'top' }); @@ -102,7 +102,7 @@ export default function InviteMember({ leftIcon={} onClick={onOpen} > - {t('Invite Member')} + {t('common:invite_member')} ) : ( <> @@ -118,14 +118,14 @@ export default function InviteMember({ > - {t('Invite Member')} + {t('common:invite_member')} {mutation.isLoading ? ( ) : ( - {t('Invite members to workspace', { + {t('common:invite_members_to_workspace', { workspace: workspaceName })} @@ -181,7 +181,7 @@ export default function InviteMember({ isDisabled={getLinkCode.isLoading} onClick={handleGenLink} > - {t('Generate invitation link')} + {t('common:generate_invitation_link')} diff --git a/frontend/desktop/src/components/team/ModifyRole.tsx b/frontend/desktop/src/components/team/ModifyRole.tsx index 6f40affe524..85e3fbfbe5d 100644 --- a/frontend/desktop/src/components/team/ModifyRole.tsx +++ b/frontend/desktop/src/components/team/ModifyRole.tsx @@ -137,7 +137,7 @@ export default function ModifyRole({ submit(); }} > - {t('Confirm')} + {t('common:confirm')} )} diff --git a/frontend/desktop/src/components/team/NsListItem.tsx b/frontend/desktop/src/components/team/NsListItem.tsx index 7989b41fb00..e8d8fed8a3c 100644 --- a/frontend/desktop/src/components/team/NsListItem.tsx +++ b/frontend/desktop/src/components/team/NsListItem.tsx @@ -61,7 +61,7 @@ const NsListItem = ({ : {})} textTransform={'capitalize'} > - {isPrivate ? t('Default Team') : teamName} + {isPrivate ? t('common:default_team') : teamName} diff --git a/frontend/desktop/src/components/team/ReciveMessage.tsx b/frontend/desktop/src/components/team/ReciveMessage.tsx index 9c0a1f4b804..65f9a82edda 100644 --- a/frontend/desktop/src/components/team/ReciveMessage.tsx +++ b/frontend/desktop/src/components/team/ReciveMessage.tsx @@ -39,7 +39,7 @@ export default function ReciveMessage({ }); const { t, i18n } = useTranslation(); const inviteTips = ({ managerName, teamName, role }: Record) => - t('Receive Tips', { + t('common:receive_tips', { managerName, teamName, role @@ -80,7 +80,7 @@ export default function ReciveMessage({ ml="18px" mr="16px" > - {t('Handle')} + {t('common:handle')} { @@ -102,7 +102,7 @@ export default function ReciveMessage({ > - {t('Accept Invitation')} + {t('common:accept_invitation')} {mutation.isLoading ? ( @@ -133,7 +133,7 @@ export default function ReciveMessage({ submit(reciveAction.Reject); }} > - {t('Reject')} + {t('common:reject')} diff --git a/frontend/desktop/src/components/team/RemoveMember.tsx b/frontend/desktop/src/components/team/RemoveMember.tsx index 0d82cda3da1..535f9eeaebd 100644 --- a/frontend/desktop/src/components/team/RemoveMember.tsx +++ b/frontend/desktop/src/components/team/RemoveMember.tsx @@ -55,12 +55,12 @@ export default function RemoveMember({ const { t, i18n } = useTranslation(); const removeKey = status === InvitedStatus.Inviting - ? t('Cancel') + ? t('common:cancel') : selfUserCrUid === targetUserCrUid - ? t('Quit') - : t('Remove'); + ? t('common:quit') + : t('common:remove'); const removeTips = - selfUserCrUid === targetUserCrUid ? t('Quit Workspace Tips') : t('Remove Member Tips'); + selfUserCrUid === targetUserCrUid ? t('common:quit_workspace_tips') : t('common:remove_member_tips'); return ( <> diff --git a/frontend/desktop/src/components/team/TeamCenter.tsx b/frontend/desktop/src/components/team/TeamCenter.tsx index 87ff4975cbd..18bc1aab970 100644 --- a/frontend/desktop/src/components/team/TeamCenter.tsx +++ b/frontend/desktop/src/components/team/TeamCenter.tsx @@ -122,7 +122,7 @@ export default function TeamCenter(props: StackProps) { mb={'4px'} > - {t('Manage Team')} + {t('common:manage_team')} @@ -160,7 +160,7 @@ export default function TeamCenter(props: StackProps) { borderBottom="1.5px solid rgba(0, 0, 0, 0.05)" > - {t('Team')} + {t('common:team')} @@ -189,7 +189,7 @@ export default function TeamCenter(props: StackProps) { ) : (
- {t('noWorkspaceCreated')} + {t('common:noworkspacecreated')}
)} @@ -203,7 +203,7 @@ export default function TeamCenter(props: StackProps) { alignItems={'stretch'} > - {t('Manage Team')} + {t('common:manage_team')} {namespace ? ( <> @@ -229,7 +229,7 @@ export default function TeamCenter(props: StackProps) { - {t('Team')} ID: {nsid} + {t('common:team')} ID: {nsid} - {t('Created Time')}:{' '} + {t('common:created_time')}:{' '} {namespace.createTime ? formatTime(namespace.createTime) : ''} @@ -256,7 +256,7 @@ export default function TeamCenter(props: StackProps) { - {t('Member List')} + {t('common:member_list')} - {t('noWorkspaceCreated')} + {t('common:noworkspacecreated')} diff --git a/frontend/desktop/src/components/team/WorkspaceToggle.tsx b/frontend/desktop/src/components/team/WorkspaceToggle.tsx index be64906f934..fb052b8936c 100644 --- a/frontend/desktop/src/components/team/WorkspaceToggle.tsx +++ b/frontend/desktop/src/components/team/WorkspaceToggle.tsx @@ -76,7 +76,7 @@ export default function WorkspaceToggle() { > - {namespace?.nstype === NSType.Private ? t('Default Team') : namespace?.teamName} + {namespace?.nstype === NSType.Private ? t('common:default_team') : namespace?.teamName} diff --git a/frontend/desktop/src/components/team/userTable.tsx b/frontend/desktop/src/components/team/userTable.tsx index 09d12ef0781..a51ec542b86 100644 --- a/frontend/desktop/src/components/team/userTable.tsx +++ b/frontend/desktop/src/components/team/userTable.tsx @@ -33,8 +33,8 @@ export default function UserTable({ nsid: string; }) { const { t } = useTranslation(); - const headList = [t('User Name'), t('Access'), t('In Time'), t('Status'), t('Operating')]; - const status = [t('Waiting'), t('Added')]; + const headList = [t('common:user_name'), t('common:access'), t('common:in_time'), t('common:status'), t('common:operating')]; + const status = [t('common:waiting'), t('common:added')]; const session = useSessionStore((s) => s.session); const userCrUid = session?.user.userCrUid; const k8s_username = session?.user.k8s_username; diff --git a/frontend/desktop/src/hooks/useDriver.tsx b/frontend/desktop/src/hooks/useDriver.tsx index 22b89d76d42..de363b85fb5 100644 --- a/frontend/desktop/src/hooks/useDriver.tsx +++ b/frontend/desktop/src/hooks/useDriver.tsx @@ -90,7 +90,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { {...props} > - {t('Click on any shadow to skip')} + {t('common:click_on_any_shadow_to_skip')} - {t('Quick application switching floating ball')} + {t('common:quick_application_switching_floating_ball')} @@ -144,7 +144,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { - {t('You can use the kubectl command directly from the terminal')} + {t('common:you_can_use_the_kubectl_command_directly_from_the_terminal')} @@ -161,7 +161,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { - {t('Help you enable high availability database')} + {t('common:help_you_enable_high_availability_database')} @@ -178,7 +178,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { - {t('Launch various third-party applications with one click')} + {t('common:launch_various_third-party_applications_with_one_click')} @@ -195,7 +195,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { - {t('You can view fees through the fee center')} + {t('common:you_can_view_fees_through_the_fee_center')} @@ -222,17 +222,17 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { - {t('deploy an application')} + {t('common:deploy_an_application')} - {t('spend')} + {t('common:spend')} 30s - {t('Completed the deployment of an nginx for the first time')} + {t('common:completed_the_deployment_of_an_nginx_for_the_first_time')} - {t('gift amount', { amount: giftAmount })} + {t('common:gift_amount', { amount: giftAmount })} @@ -249,7 +249,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { driverObj.destroy(); }} > - {t('Next time')} + {t('common:next_time')} @@ -304,7 +304,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { transform="translate(-50%, -50%)" > - {t('Hello, welcome')} + {t('common:hello_welcome')} Sealos @@ -336,7 +336,7 @@ export default function useDriver({ openDesktopApp }: { openDesktopApp: any }) { startGuide(); }} > - {t('Start your Sealos journey')} + {t('common:start_your_sealos_journey')} diff --git a/frontend/desktop/src/pages/WorkspaceInvite.tsx b/frontend/desktop/src/pages/WorkspaceInvite.tsx index 8288cb3b352..602265d8010 100644 --- a/frontend/desktop/src/pages/WorkspaceInvite.tsx +++ b/frontend/desktop/src/pages/WorkspaceInvite.tsx @@ -29,7 +29,7 @@ const Callback: NextPage = () => { mutationFn: verifyInviteCodeRequest }); const inviteTips = ({ managerName, teamName, role }: Record) => - t('Receive Tips', { + t('common:receive_tips', { managerName, teamName, role @@ -122,7 +122,7 @@ const Callback: NextPage = () => { {isValid ? ( - {t('Invitation reminder')} + {t('common:invitation_reminder')} {inviteTips({ @@ -141,16 +141,16 @@ const Callback: NextPage = () => { await acceptHandle(); }} > - {t('Accept Invitation')} + {t('common:accept_invitation')} ) : infoResp.isError ? ( - {t('Invalid invitation link')} + {t('common:invalid_invitation_link')} - {t('Redirecting to homepage in 3 seconds')} + {t('common:redirecting_to_homepage_in_3_seconds')} ) : null} diff --git a/frontend/desktop/src/pages/signin.tsx b/frontend/desktop/src/pages/signin.tsx index 9d0fcbb21f1..80e7bf6f3b8 100644 --- a/frontend/desktop/src/pages/signin.tsx +++ b/frontend/desktop/src/pages/signin.tsx @@ -6,9 +6,11 @@ import { QueryClient, dehydrate } from '@tanstack/react-query'; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import Head from 'next/head'; import { useEffect } from 'react'; +import { useTranslation } from 'next-i18next'; export default function SigninPage() { const { layoutConfig } = useConfigStore(); + const { t } = useTranslation(); useEffect(() => { const url = sessionStorage.getItem('accessTemplatesNoLogin'); diff --git a/frontend/desktop/src/types/i18next.d.ts b/frontend/desktop/src/types/i18next.d.ts new file mode 100644 index 00000000000..2bb75540b8b --- /dev/null +++ b/frontend/desktop/src/types/i18next.d.ts @@ -0,0 +1,25 @@ +import 'i18next'; + +import common from '../../public/locales/zh/common.json'; +import cloudProviders from '../../public/locales/zh/cloudProviders.json'; +import error from '../../public/locales/zh/error.json'; + +export interface I18nNamespaces { + common: typeof common; + cloudProviders: typeof cloudProviders; + error: typeof error; +} + +export type I18nNsType = (keyof I18nNamespaces)[]; + +export type I18nCommonKey = keyof I18nNamespaces['common']; +export type I18nCloudProvidersKey = keyof I18nNamespaces['cloudProviders']; +export type I18nErrorKey = keyof I18nNamespaces['error']; + +declare module 'i18next' { + interface CustomTypeOptions { + returnNull: false; + defaultNS: ['common', 'cloudProviders', 'error']; + resources: I18nNamespaces; + } +} diff --git a/frontend/desktop/tsconfig.json b/frontend/desktop/tsconfig.json index ac5ba948a69..d442c208fdb 100644 --- a/frontend/desktop/tsconfig.json +++ b/frontend/desktop/tsconfig.json @@ -15,7 +15,8 @@ "src/**/*.ts", "src/**/*.tsx", "./scripts/**/*.ts", - "./prisma/**/*.ts" + "./prisma/**/*.ts", + "src/types/i18next.d.ts" ], "extends": "../tsconfig.web.json" } diff --git a/frontend/package.json b/frontend/package.json index 1c58f207c92..aadcad2a889 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,14 +28,17 @@ "prettier": "^2.8.8" }, "dependencies": { - "@chakra-ui/icons": "^2.1.1", - "@chakra-ui/system": "^2.6.1", "@chakra-ui/anatomy": "^2.2.1", + "@chakra-ui/icons": "^2.1.1", "@chakra-ui/next-js": "^2.1.5", "@chakra-ui/react": "^2.8.1", + "@chakra-ui/system": "^2.6.1", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "framer-motion": "^10.16.4", + "i18next": "^23.11.5", + "next-i18next": "^15.3.0", + "react-i18next": "^14.1.2", "typescript": "^5.2.2" }, "pnpm": { diff --git a/frontend/packages/client-sdk/package.json b/frontend/packages/client-sdk/package.json index 47230918d99..bee66fa54a8 100644 --- a/frontend/packages/client-sdk/package.json +++ b/frontend/packages/client-sdk/package.json @@ -70,4 +70,4 @@ "peerDependencies": { "@kubernetes/client-node": "^0.18.1" } -} +} \ No newline at end of file diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 123703a8e2c..ce3a28c29c6 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -32,6 +32,15 @@ importers: framer-motion: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) + i18next: + specifier: ^23.11.5 + version: 23.12.1 + next-i18next: + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.5.6)(react-i18next@14.1.2)(react@18.2.0) + react-i18next: + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) typescript: specifier: ^5.2.2 version: 5.2.2 @@ -121,8 +130,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^10.0.2 version: 10.0.3 @@ -154,8 +163,8 @@ importers: specifier: 13.3.0 version: 13.3.0(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.3.0)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.3.0)(react-i18next@14.1.2)(react@18.2.0) next-pwa: specifier: ^5.6.0 version: 5.6.0(@babel/core@7.23.5)(next@13.3.0)(webpack@5.89.0) @@ -190,8 +199,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) sass: specifier: ^1.68.0 version: 1.69.5 @@ -398,8 +407,8 @@ importers: specifier: ^1.2.1 version: 1.2.1 i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^10.0.2 version: 10.0.3 @@ -410,14 +419,14 @@ importers: specifier: 13.4.5 version: 13.4.5(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.4.5)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.4.5)(react-i18next@14.1.2)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) sealos-desktop-sdk: specifier: workspace:* version: link:../../packages/client-sdk @@ -513,8 +522,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -537,8 +546,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -555,8 +564,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -682,8 +691,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -718,8 +727,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -739,8 +748,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -875,8 +884,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -896,8 +905,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -917,8 +926,8 @@ importers: specifier: 18.2.0 version: 18.2.0(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) sealos-desktop-sdk: specifier: workspace:* version: link:../../packages/client-sdk @@ -1020,8 +1029,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -1044,8 +1053,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1065,8 +1074,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -1183,8 +1192,8 @@ importers: specifier: ^5.2.0 version: 5.4.0 i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -1213,8 +1222,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1234,8 +1243,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -1349,8 +1358,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -1376,8 +1385,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1397,8 +1406,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -1499,6 +1508,9 @@ importers: framer-motion: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) + i18next: + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^10.0.3 version: 10.0.3 @@ -1517,6 +1529,9 @@ importers: next: specifier: 13.5.4 version: 13.5.4(react-dom@18.2.0)(react@18.2.0) + next-i18next: + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.5.4)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1529,6 +1544,9 @@ importers: react-dom: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) + react-i18next: + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-icons: specifier: ^5.0.1 version: 5.0.1(react@18.2.0) @@ -1672,8 +1690,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -1702,8 +1720,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) node-cron: specifier: ^3.0.3 version: 3.0.3 @@ -1726,8 +1744,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -1844,8 +1862,8 @@ importers: specifier: ^7.0.0 version: 7.0.0 i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^10.0.3 version: 10.0.3 @@ -1862,8 +1880,8 @@ importers: specifier: 13.5.6 version: 13.5.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.5.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.5.6)(react-i18next@14.1.2)(react@18.2.0) react: specifier: ^18 version: 18.2.0 @@ -1877,8 +1895,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -2004,8 +2022,8 @@ importers: specifier: ^5.2.0 version: 5.4.0 i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -2028,8 +2046,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) node-cron: specifier: ^3.0.3 version: 3.0.3 @@ -2052,8 +2070,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -2155,8 +2173,8 @@ importers: specifier: 13.2.4 version: 13.2.4(eslint@8.36.0)(typescript@5.2.2) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -2173,8 +2191,8 @@ importers: specifier: 13.2.4 version: 13.2.4(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.2.4)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.2.4)(react-i18next@14.1.2)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -2182,8 +2200,8 @@ importers: specifier: 18.2.0 version: 18.2.0(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) sealos-desktop-sdk: specifier: workspace:* version: link:../../packages/client-sdk @@ -2273,8 +2291,8 @@ importers: specifier: ^10.16.4 version: 10.16.5(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: ^22.5.1 - version: 22.5.1 + specifier: ^23.11.5 + version: 23.12.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -2309,8 +2327,8 @@ importers: specifier: 13.1.6 version: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) next-i18next: - specifier: ^13.3.0 - version: 13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0) + specifier: ^15.3.0 + version: 15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -2330,8 +2348,8 @@ importers: specifier: ^7.46.2 version: 7.48.2(react@18.2.0) react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.1.2 + version: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.37)(react@18.2.0) @@ -15037,14 +15055,14 @@ packages: resolution: {integrity: sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==} dev: false - /i18next-fs-backend@2.3.0: - resolution: {integrity: sha512-N0SS2WojoVIh2x/QkajSps8RPKzXqryZsQh12VoFY4cLZgkD+62EPY2fY+ZjkNADu8xA5I5EadQQXa8TXBKN3w==} + /i18next-fs-backend@2.3.1: + resolution: {integrity: sha512-tvfXskmG/9o+TJ5Fxu54sSO5OkY6d+uMn+K6JiUGLJrwxAVfer+8V3nU8jq3ts9Pe5lXJv4b1N7foIjJ8Iy2Gg==} dev: false - /i18next@22.5.1: - resolution: {integrity: sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA==} + /i18next@23.12.1: + resolution: {integrity: sha512-l4y291ZGRgUhKuqVSiqyuU2DDzxKStlIWSaoNBR4grYmh0X+pRYbFpTMs3CnJ5ECKbOI8sQcJ3PbTUfLgPRaMA==} dependencies: - '@babel/runtime': 7.23.4 + '@babel/runtime': 7.24.0 dev: false /iconv-lite@0.4.4: @@ -17490,104 +17508,124 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: false - /next-i18next@13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0): - resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + /next-i18next@15.3.0(i18next@23.12.1)(next@13.1.6)(react-i18next@14.1.2)(react@18.2.0): + resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} engines: {node: '>=14'} peerDependencies: - i18next: ^22.0.6 + i18next: '>= 23.7.13' next: '>= 12.0.0' react: '>= 17.0.2' - react-i18next: ^12.2.0 + react-i18next: '>= 13.5.0' dependencies: '@babel/runtime': 7.24.0 '@types/hoist-non-react-statics': 3.3.5 core-js: 3.33.3 hoist-non-react-statics: 3.3.2 - i18next: 22.5.1 - i18next-fs-backend: 2.3.0 + i18next: 23.12.1 + i18next-fs-backend: 2.3.1 next: 13.1.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) react: 18.2.0 - react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + react-i18next: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) dev: false - /next-i18next@13.3.0(i18next@22.5.1)(next@13.2.4)(react-i18next@12.3.1)(react@18.2.0): - resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + /next-i18next@15.3.0(i18next@23.12.1)(next@13.2.4)(react-i18next@14.1.2)(react@18.2.0): + resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} engines: {node: '>=14'} peerDependencies: - i18next: ^22.0.6 + i18next: '>= 23.7.13' next: '>= 12.0.0' react: '>= 17.0.2' - react-i18next: ^12.2.0 + react-i18next: '>= 13.5.0' dependencies: '@babel/runtime': 7.24.0 '@types/hoist-non-react-statics': 3.3.5 core-js: 3.33.3 hoist-non-react-statics: 3.3.2 - i18next: 22.5.1 - i18next-fs-backend: 2.3.0 + i18next: 23.12.1 + i18next-fs-backend: 2.3.1 next: 13.2.4(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) react: 18.2.0 - react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + react-i18next: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) dev: false - /next-i18next@13.3.0(i18next@22.5.1)(next@13.3.0)(react-i18next@12.3.1)(react@18.2.0): - resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + /next-i18next@15.3.0(i18next@23.12.1)(next@13.3.0)(react-i18next@14.1.2)(react@18.2.0): + resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} engines: {node: '>=14'} peerDependencies: - i18next: ^22.0.6 + i18next: '>= 23.7.13' next: '>= 12.0.0' react: '>= 17.0.2' - react-i18next: ^12.2.0 + react-i18next: '>= 13.5.0' dependencies: '@babel/runtime': 7.24.0 '@types/hoist-non-react-statics': 3.3.5 core-js: 3.33.3 hoist-non-react-statics: 3.3.2 - i18next: 22.5.1 - i18next-fs-backend: 2.3.0 + i18next: 23.12.1 + i18next-fs-backend: 2.3.1 next: 13.3.0(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) react: 18.2.0 - react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + react-i18next: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) dev: false - /next-i18next@13.3.0(i18next@22.5.1)(next@13.4.5)(react-i18next@12.3.1)(react@18.2.0): - resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + /next-i18next@15.3.0(i18next@23.12.1)(next@13.4.5)(react-i18next@14.1.2)(react@18.2.0): + resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} engines: {node: '>=14'} peerDependencies: - i18next: ^22.0.6 + i18next: '>= 23.7.13' next: '>= 12.0.0' react: '>= 17.0.2' - react-i18next: ^12.2.0 + react-i18next: '>= 13.5.0' dependencies: '@babel/runtime': 7.24.0 '@types/hoist-non-react-statics': 3.3.5 core-js: 3.33.3 hoist-non-react-statics: 3.3.2 - i18next: 22.5.1 - i18next-fs-backend: 2.3.0 + i18next: 23.12.1 + i18next-fs-backend: 2.3.1 next: 13.4.5(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) react: 18.2.0 - react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + react-i18next: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) + dev: false + + /next-i18next@15.3.0(i18next@23.12.1)(next@13.5.4)(react-i18next@14.1.2)(react@18.2.0): + resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} + engines: {node: '>=14'} + peerDependencies: + i18next: '>= 23.7.13' + next: '>= 12.0.0' + react: '>= 17.0.2' + react-i18next: '>= 13.5.0' + dependencies: + '@babel/runtime': 7.24.0 + '@types/hoist-non-react-statics': 3.3.5 + core-js: 3.33.3 + hoist-non-react-statics: 3.3.2 + i18next: 23.12.1 + i18next-fs-backend: 2.3.1 + next: 13.5.4(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-i18next: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) dev: false - /next-i18next@13.3.0(i18next@22.5.1)(next@13.5.6)(react-i18next@12.3.1)(react@18.2.0): - resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + /next-i18next@15.3.0(i18next@23.12.1)(next@13.5.6)(react-i18next@14.1.2)(react@18.2.0): + resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} engines: {node: '>=14'} peerDependencies: - i18next: ^22.0.6 + i18next: '>= 23.7.13' next: '>= 12.0.0' react: '>= 17.0.2' - react-i18next: ^12.2.0 + react-i18next: '>= 13.5.0' dependencies: '@babel/runtime': 7.24.0 '@types/hoist-non-react-statics': 3.3.5 core-js: 3.33.3 hoist-non-react-statics: 3.3.2 - i18next: 22.5.1 - i18next-fs-backend: 2.3.0 + i18next: 23.12.1 + i18next-fs-backend: 2.3.1 next: 13.5.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 - react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + react-i18next: 14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0) dev: false /next-pwa@5.6.0(@babel/core@7.23.5)(next@13.3.0)(webpack@5.89.0): @@ -19365,10 +19403,10 @@ packages: react: 18.2.0 dev: false - /react-i18next@12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-5v8E2XjZDFzK7K87eSwC7AJcAkcLt5xYZ4+yTPDAW1i7C93oOY1dnr4BaQM7un4Hm+GmghuiPvevWwlca5PwDA==} + /react-i18next@14.1.2(i18next@23.12.1)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-FSIcJy6oauJbGEXfhUgVeLzvWBhIBIS+/9c6Lj4niwKZyGaGb4V4vUbATXSlsHJDXXB+ociNxqFNiFuV1gmoqg==} peerDependencies: - i18next: '>= 19.0.0' + i18next: '>= 23.2.3' react: '>= 16.8.0' react-dom: '*' react-native: '*' @@ -19378,9 +19416,9 @@ packages: react-native: optional: true dependencies: - '@babel/runtime': 7.23.4 + '@babel/runtime': 7.24.0 html-parse-stringify: 3.0.1 - i18next: 22.5.1 + i18next: 23.12.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false diff --git a/frontend/providers/adminer/package.json b/frontend/providers/adminer/package.json index 822ed720b27..87559629405 100644 --- a/frontend/providers/adminer/package.json +++ b/frontend/providers/adminer/package.json @@ -13,13 +13,13 @@ "@tanstack/react-query": "^4.35.3", "axios": "1.4.0", "clsx": "^1.2.1", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^10.0.2", "js-yaml": "^4.1.0", "next": "13.4.5", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "react": "18.2.0", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "sealos-desktop-sdk": "workspace:*", "typescript": "^5.2.2", "zustand": "^4.4.1" diff --git a/frontend/providers/applaunchpad/.gitignore b/frontend/providers/applaunchpad/.gitignore index da4ef4aea5c..d900c86d325 100644 --- a/frontend/providers/applaunchpad/.gitignore +++ b/frontend/providers/applaunchpad/.gitignore @@ -35,7 +35,6 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts /public/trainData/ -/.vscode/ platform.json .yalc/ yalc.lock diff --git a/frontend/providers/applaunchpad/.vscode/settings.json b/frontend/providers/applaunchpad/.vscode/settings.json new file mode 100644 index 00000000000..488915e5da7 --- /dev/null +++ b/frontend/providers/applaunchpad/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "i18n-ally.localesPaths": [ + "public/locales" + ], + "i18n-ally.enabledParsers": [ + "json", + "yaml", + "js", + "ts" + ], + "i18n-ally.keystyle": "nested", + "i18n-ally.sortKeys": true, + "i18n-ally.keepFulfilled": false, + "i18n-ally.sourceLanguage": "zh", + "i18n-ally.displayLanguage": "zh", + "i18n-ally.namespace": true, + "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", + "i18n-ally.extract.targetPickingStrategy": "most-similar-by-key" +} \ No newline at end of file diff --git a/frontend/providers/applaunchpad/next-i18next.config.js b/frontend/providers/applaunchpad/next-i18next.config.js index 8dca5135fe0..0e139df71ab 100644 --- a/frontend/providers/applaunchpad/next-i18next.config.js +++ b/frontend/providers/applaunchpad/next-i18next.config.js @@ -8,5 +8,6 @@ module.exports = { defaultLocale: 'zh', locales: ['en', 'zh'], localeDetection: false - } -}; + }, + reloadOnPrerender: process.env.NODE_ENV === 'development' +} diff --git a/frontend/providers/applaunchpad/package.json b/frontend/providers/applaunchpad/package.json index fe79aa3af8c..ee648b4e689 100644 --- a/frontend/providers/applaunchpad/package.json +++ b/frontend/providers/applaunchpad/package.json @@ -32,7 +32,7 @@ "fast-json-patch": "^3.1.1", "formidable": "^3.5.1", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -40,13 +40,13 @@ "lodash": "^4.17.21", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "sass": "^1.68.0", diff --git a/frontend/providers/applaunchpad/src/types/i18next.d.ts b/frontend/providers/applaunchpad/src/types/i18next.d.ts new file mode 100644 index 00000000000..a61935962fe --- /dev/null +++ b/frontend/providers/applaunchpad/src/types/i18next.d.ts @@ -0,0 +1,9 @@ +import 'i18next'; + +import common from '../../public/locales/zh/common.json'; + +export interface I18nNamespaces { + common: typeof common; +} + +export type I18nNsType = (keyof I18nNamespaces)[]; diff --git a/frontend/providers/applaunchpad/src/utils/i18n.ts b/frontend/providers/applaunchpad/src/utils/i18n.ts index 703a65b0b0f..f3672d84c35 100644 --- a/frontend/providers/applaunchpad/src/utils/i18n.ts +++ b/frontend/providers/applaunchpad/src/utils/i18n.ts @@ -1,10 +1,11 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import { LANG_KEY } from './cookieUtils'; +import { I18nNsType } from '@/types/i18next'; -export const serviceSideProps = (content: any) => { +export const serviceSideProps = (content: any, ns: I18nNsType = []) => { return serverSideTranslations( content.req.cookies[LANG_KEY] || 'zh', - undefined, + ['common', ...ns], null, content.locales ); diff --git a/frontend/providers/cloudserver/.gitignore b/frontend/providers/cloudserver/.gitignore index 52364be8ecb..1153eb97a75 100644 --- a/frontend/providers/cloudserver/.gitignore +++ b/frontend/providers/cloudserver/.gitignore @@ -35,7 +35,6 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts /public/trainData/ -/.vscode/ platform.json .yalc/ yalc.lock diff --git a/frontend/providers/cloudserver/package.json b/frontend/providers/cloudserver/package.json index 7ccce1513b3..05bc6c7d2c1 100644 --- a/frontend/providers/cloudserver/package.json +++ b/frontend/providers/cloudserver/package.json @@ -27,7 +27,7 @@ "decimal.js": "^10.4.3", "echarts": "^5.4.3", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -39,14 +39,14 @@ "multer": "1.4.5-lts.1", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "18.2.0", "react-day-picker": "^8.8.2", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "sass": "^1.68.0", diff --git a/frontend/providers/costcenter/package.json b/frontend/providers/costcenter/package.json index 14596c915fb..6271cd8281e 100644 --- a/frontend/providers/costcenter/package.json +++ b/frontend/providers/costcenter/package.json @@ -32,21 +32,21 @@ "echarts-for-react": "^3.0.2", "formik": "^2.4.5", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", "lodash": "^4.17.21", "mongodb": "^5.9.0", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "qrcode.react": "^3.1.0", "react": "18.2.0", "react-activation": "^0.12.4", "react-day-picker": "^8.8.2", "react-dom": "18.2.0", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "sealos-desktop-sdk": "workspace:*", "typescript": "^5.2.2", "zustand": "^4.4.1" diff --git a/frontend/providers/cronjob/package.json b/frontend/providers/cronjob/package.json index fdb8dbc2141..ae7f050606f 100644 --- a/frontend/providers/cronjob/package.json +++ b/frontend/providers/cronjob/package.json @@ -20,8 +20,8 @@ "@emotion/styled": "^11.11.0", "@kubernetes/client-node": "^0.18.1", "@next/font": "13.1.6", - "@tanstack/react-query": "^4.35.3", "@sealos/ui": "workspace:^", + "@tanstack/react-query": "^4.35.3", "ansi_up": "^5.2.1", "axios": "^1.5.1", "cron-parser": "^4.9.0", @@ -30,7 +30,7 @@ "dayjs": "^1.11.10", "echarts": "^5.4.3", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -38,14 +38,14 @@ "lodash": "^4.17.21", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "18.2.0", "react-day-picker": "^8.8.2", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "sass": "^1.68.0", diff --git a/frontend/providers/dbprovider/package.json b/frontend/providers/dbprovider/package.json index 17071f72e1b..a9439b9873b 100644 --- a/frontend/providers/dbprovider/package.json +++ b/frontend/providers/dbprovider/package.json @@ -20,6 +20,7 @@ "@emotion/styled": "^11.11.0", "@kubernetes/client-node": "^0.18.1", "@next/font": "13.1.6", + "@sealos/ui": "workspace:^", "@tanstack/react-query": "^4.35.3", "ansi_up": "^5.2.1", "axios": "^1.5.1", @@ -28,7 +29,7 @@ "echarts": "^5.4.3", "framer-motion": "^10.16.4", "github-markdown-css": "^5.2.0", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -38,19 +39,18 @@ "multer": "1.4.5-lts.1", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "18.2.0", "react-day-picker": "^8.8.2", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "sass": "^1.68.0", "sealos-desktop-sdk": "workspace:*", - "@sealos/ui": "workspace:^", "typescript": "^5.2.2", "zustand": "^4.4.1" }, diff --git a/frontend/providers/invite/package.json b/frontend/providers/invite/package.json index 3b05447ba51..973033da4a2 100644 --- a/frontend/providers/invite/package.json +++ b/frontend/providers/invite/package.json @@ -25,7 +25,7 @@ "dayjs": "^1.11.10", "echarts": "^5.4.3", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -34,14 +34,14 @@ "mongodb": "^5.9.0", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "18.2.0", "react-day-picker": "^8.8.2", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "sass": "^1.68.0", diff --git a/frontend/providers/kubepanel/package.json b/frontend/providers/kubepanel/package.json index ddd2c926191..d60bdcf831d 100644 --- a/frontend/providers/kubepanel/package.json +++ b/frontend/providers/kubepanel/package.json @@ -22,16 +22,19 @@ "byline": "^5.0.0", "eventsource": "^2.0.2", "framer-motion": "^10.16.4", + "i18next": "^23.11.5", "immer": "^10.0.3", "js-yaml": "^4.1.0", "lodash": "^4.17.21", "moment": "^2.29.4", "moment-timezone": "^0.5.43", "next": "13.5.4", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-i18next": "^14.1.2", "react-icons": "^5.0.1", "rfc6902": "^5.0.1", "sealos-desktop-sdk": "workspace:*", diff --git a/frontend/providers/license/package.json b/frontend/providers/license/package.json index b29fe1a4193..aec775efd0e 100644 --- a/frontend/providers/license/package.json +++ b/frontend/providers/license/package.json @@ -29,7 +29,7 @@ "decimal.js": "^10.4.3", "echarts": "^5.4.3", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -39,7 +39,7 @@ "mongodb": "^5.9.0", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "node-cron": "^3.0.3", "nprogress": "^0.2.0", "prettier": "^2.8.8", @@ -47,7 +47,7 @@ "react-day-picker": "^8.8.2", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "sass": "^1.68.0", diff --git a/frontend/providers/objectstorage/package.json b/frontend/providers/objectstorage/package.json index 93f81a2f6d7..62d2423ce47 100644 --- a/frontend/providers/objectstorage/package.json +++ b/frontend/providers/objectstorage/package.json @@ -27,18 +27,18 @@ "echarts-for-react": "^3.0.2", "framer-motion": "^10.16.4", "fuse.js": "^7.0.0", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^10.0.3", "js-yaml": "^4.1.0", "jszip": "^3.10.1", "lodash": "^4.17.21", "next": "13.5.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "react": "^18", "react-dom": "^18", "react-dropzone": "^14.2.3", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "sealos-desktop-sdk": "workspace:^", "typescript": "^5.2.2", diff --git a/frontend/providers/template/package.json b/frontend/providers/template/package.json index 1d6318cae6c..7c0f55ad8b3 100644 --- a/frontend/providers/template/package.json +++ b/frontend/providers/template/package.json @@ -34,7 +34,7 @@ "echarts": "^5.4.3", "fast-json-patch": "^3.1.1", "github-markdown-css": "^5.2.0", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -42,7 +42,7 @@ "lodash": "^4.17.21", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "node-cron": "^3.0.3", "nprogress": "^0.2.0", "octokit": "^3.1.1", @@ -50,7 +50,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "rehype-raw": "^6.1.1", diff --git a/frontend/providers/terminal/package.json b/frontend/providers/terminal/package.json index 0ca2f2b5c3e..e39c37bab64 100644 --- a/frontend/providers/terminal/package.json +++ b/frontend/providers/terminal/package.json @@ -15,16 +15,16 @@ "clsx": "^1.2.1", "eslint": "8.36.0", "eslint-config-next": "13.2.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-yaml": "^4.1.0", "lodash": "^4.17.21", "nanoid": "^4.0.2", "next": "13.2.4", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "react": "18.2.0", "react-dom": "18.2.0", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "sealos-desktop-sdk": "workspace:*", "typescript": "^5.2.2", "zustand": "^4.4.1" diff --git a/frontend/providers/workorder/package.json b/frontend/providers/workorder/package.json index 03f83a955be..334a7de1151 100644 --- a/frontend/providers/workorder/package.json +++ b/frontend/providers/workorder/package.json @@ -28,7 +28,7 @@ "dayjs": "^1.11.10", "echarts": "^5.4.3", "framer-motion": "^10.16.4", - "i18next": "^22.5.1", + "i18next": "^23.11.5", "immer": "^9.0.21", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", @@ -40,14 +40,14 @@ "multer": "1.4.5-lts.1", "nanoid": "^4.0.2", "next": "13.1.6", - "next-i18next": "^13.3.0", + "next-i18next": "^15.3.0", "nprogress": "^0.2.0", "prettier": "^2.8.8", "react": "18.2.0", "react-day-picker": "^8.8.2", "react-dom": "18.2.0", "react-hook-form": "^7.46.2", - "react-i18next": "^12.3.1", + "react-i18next": "^14.1.2", "react-markdown": "^8.0.7", "react-syntax-highlighter": "^15.5.0", "remark-breaks": "^4.0.0",