Skip to content

Commit

Permalink
feat(frontend): update i18n default loader
Browse files Browse the repository at this point in the history
  • Loading branch information
gangjun06 committed Nov 27, 2022
1 parent c14d1d4 commit 14bffeb
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 87 deletions.
7 changes: 6 additions & 1 deletion frontend/i18n.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
const workaround = require("next-translate/lib/cjs/plugin/utils.js");

workaround.defaultLoader =
"(l, n) => import(`@next-translate-root/locales/${l}.json`).then(m => m?.default[n] ?? {} )";

module.exports = {
locales: ["en-US", "ko-KR"],
defaultLocale: "en-US",
pages: {
"*": ["common", "nav"],
"reg:^/(login|signup)": ["auth"],
"rgx:^/(login|signup)": ["auth"],
"/dashboard/[id]": ["dashboard"],
},
};
87 changes: 87 additions & 0 deletions frontend/locales/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"common": {
"error_project-already-exists": "A project with this name already exists.",
"need-login": " To use Infisical, please log in through a device with larger dimensions. ",
"email": "Email",
"password": "Password",
"verify": "Verify",
"first-name": "First Name",
"last-name": "Last Name",
"logout": "Log Out",
"validate-required": "Please input your {{name}}",
"password-validate": "Password should contain at least:",
"password-validate-length": "14 characters",
"password-validate-case": "1 lowercase character",
"password-validate-number": "1 number",
"maintenance-alert": "We are experiencing minor technical difficulties. We are working on solving it right now. Please come back in a few minutes.",
"click-to-copy": "Click to copy",
"project-id": "Project ID",
"save-changes": "Save Changes",
"drop-zone": "Drag and drop your .env file here.",
"drop-zone-keys": "Drag and drop your .env file here to add more keys."
},
"nav": {
"support": {
"slack": "[NEW] Join Slack Forum",
"docs": "Read Docs",
"issue": "Open a Github Issue",
"email": "Send us an Email"
},
"user": {
"signed-in-as": "SIGNED IN AS",
"current-organization": "CURRENT ORGANIZATION",
"usage-billing": "Usage & Billing",
"invite": "Invite Members",
"other-organizations": "OTHER ORGANIZATION"
},
"menu": {
"project": "PROJECT",
"secrets": "Secrets",
"members": "Members",
"integrations": "Integrations",
"project-settings": "Project Settings"
}
},
"auth": {
"meta": {
"login": {
"title": "Login | Infiscal",
"og-title": "Log In to Infisical",
"og-description": "Infisical a simple end-to-end encrypted platform that enables teams to sync and manage their .env files."
},
"signup": {
"title": "Sign Up | Infiscal",
"og-title": "Replace .env files with 1 line of code. Sign Up for Infisical in 3 minutes.",
"og-description": "Infisical a simple end-to-end encrypted platform that enables teams to sync and manage API-keys and environemntal variables. Works with Node.js, Next.js, Gatsby, Nest.js..."
}
},
"login": "Log In",
"signup": "Sign Up",
"need-account": "Need an Infisical account?",
"create-account": "Create an account",
"already-have-account": "Have an account? Log in",
"forgot-password": "Forgot your password?",
"step1-start": "Let's get started",
"step1-privacy": "By creating an account, you agree to our Terms and have read and acknowledged the Privacy Policy.",
"step1-submit": "Get Started",
"step2-message": "<wrapper>We've sent a verification email to</wrapper><email>{{email}}</email>",
"step2-code-error": "Oops. Your code is wrong. Please try again.",
"step2-spam-alert": "Make sure to check your spam inbox.",
"step3-message": "Almost there!",
"step4-message": "Save your Emergency Kit",
"step4-description1": "If you get locked out of your account, your Emergency Kit is the only way to sign in.",
"step4-description2": "We recommend you download it and keep it somewhere safe.",
"step4-description3": "It contains your Secret Key which we cannot access or recover for you if you lose it.",
"step4-download": "Download PDF"
},
"dashboard": {
"search-keys": "Search keys...",
"add-key": "Add Key",
"personal": "Personal",
"personal-description": "Personal keys are only visible to you",
"shared": "Shared",
"shared-description": "Shared keys are visible to your whole team",
"make-shared": "Make Shared",
"make-personal": "Make Personal"
}
}
32 changes: 0 additions & 32 deletions frontend/locales/en-US/auth.json

This file was deleted.

21 changes: 0 additions & 21 deletions frontend/locales/en-US/common.json

This file was deleted.

10 changes: 0 additions & 10 deletions frontend/locales/en-US/dashboard.json

This file was deleted.

22 changes: 0 additions & 22 deletions frontend/locales/en-US/nav.json

This file was deleted.

6 changes: 6 additions & 0 deletions frontend/locales/ko-KR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"common": {},
"nav": {},
"auth": {},
"dashboard": {}
}
1 change: 0 additions & 1 deletion frontend/locales/ko-KR/common.json

This file was deleted.

0 comments on commit 14bffeb

Please sign in to comment.