Skip to content

Commit

Permalink
refactor: enhance i18n type annotations for better developer experience
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 committed Jul 12, 2024
1 parent 1b92dcd commit 374d139
Show file tree
Hide file tree
Showing 107 changed files with 778 additions and 636 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ tmp
**/.DS_Store
node_modules
vendor
.vscode/
pkg/registry/save/testdata/registry
.dummy.report.md
deploy/cloud/tars
20 changes: 20 additions & 0 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
}
19 changes: 19 additions & 0 deletions frontend/desktop/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
}
6 changes: 3 additions & 3 deletions frontend/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
189 changes: 64 additions & 125 deletions frontend/desktop/public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
{
"Cost Center": "Cost Center",
"Laf on Sealos": "Laf on Sealos",
"Abdication": "Abdication",
"Accept": "Accept",
"Accept Invitation": "Accept Invitation",
"Access": "Access",
"Account Settings": "Account Settings",
"Added": "Added",
"Alarm Pod": "Alarm Pod: {{count}}",
"Alerts": "Alerts",
"All Apps": "All Apps",
"App Info": "App Info",
"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",
Expand All @@ -35,122 +28,68 @@
"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",
"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",
"Invitation reminder": "Invitation reminder",
"Invite Member": "Invite Member",
"Invite members to workspace ": "Invite members to workspace {{workspace}}",
"Jump Over": "Jump Over",
"Laf on Sealos": "Laf on Sealos",
"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",
"Abdication": "Abdication",
"Team": "Workspace",
"Manage Team": "Manage Workspace",
"Member List": "Member List",
"Created Time": "Created Time",
"Create Team": "Create Workspace",
"noWorkspaceCreated": "You haven't created a workspace yet",
"Memory": "Memory",
"Message Center": "Message Center",
"Monitor": "Monitor",
"More Apps": "More Apps",
"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",
"Next time": "Next",
"No Apps Found": "No Apps Found",
"Official account login": "Official account login",
"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",
"Order Number": "Order Number",
"Password": "Password",
"Password Login": "with Password",
"Payment Result": "Payment Result",
"Payment Status": "Payment Status",
"Payment Successful": "Payment Successful",
"Please read and agree to the agreement": "Please read and agree to the agreement",
"Privacy Policy": "Privacy Policy",
"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~",
"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.",
"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",
"Doc": "Doc",
"Official account login": "Official account login",
"Redirecting to homepage in 3 seconds": "Redirecting to homepage in 3 seconds",
"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",
"Reject": "Reject",
"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",
"No Apps Found": "No Apps Found",
"Select Amount": "Select Amount",
"Service Agreement": "Service Agreement",
"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",
"Work Order": "Work Order",
"Total Amount": "Total Amount",
"Under active development": "Under active development 🚧",
"Sealos Copilot": "Sealos Copilot",
"Avatar": "Avatar",
Expand All @@ -174,10 +113,10 @@
"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 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",
Expand All @@ -200,4 +139,4 @@
"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?"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"Singapore": "Singapore",
"Guangzhou": "Guangzhou",
"Hangzhou": "Hangzhou"
}
}
Loading

0 comments on commit 374d139

Please sign in to comment.