diff --git a/frontend/components/dashboard/DropZone.js b/frontend/components/dashboard/DropZone.js index 5549e0821..3e5e103d9 100644 --- a/frontend/components/dashboard/DropZone.js +++ b/frontend/components/dashboard/DropZone.js @@ -9,6 +9,8 @@ import Image from "next/image"; import parse from "../utilities/file"; import Button from "../basic/buttons/Button"; +import useTranslation from "next-translate/useTranslation"; + const DropZone = ({ setData, setErrorDragAndDrop, @@ -17,8 +19,10 @@ const DropZone = ({ addPresetRow, setButtonReady, keysExist, - numCurrentRows + numCurrentRows, }) => { + const { t } = useTranslation(); + const handleDragEnter = (e) => { e.preventDefault(); e.stopPropagation(); @@ -50,15 +54,14 @@ const DropZone = ({ var file = e.dataTransfer.files[0], reader = new FileReader(); reader.onload = function (event) { - const keyPairs = parse(event.target.result) - const newData = Object.keys(keyPairs) - .map((key, index) => [ - guidGenerator(), - numCurrentRows + index, - key, - keyPairs[key], - "shared", - ]); + const keyPairs = parse(event.target.result); + const newData = Object.keys(keyPairs).map((key, index) => [ + guidGenerator(), + numCurrentRows + index, + key, + keyPairs[key], + "shared", + ]); setData(newData); setButtonReady(true); }; @@ -84,7 +87,7 @@ const DropZone = ({ .split("\n") .map((line, index) => [ guidGenerator(), - numCurrentRows + index, + numCurrentRows + index, line.split("=")[0], line.split("=").slice(1, line.split("=").length).join("="), "shared", @@ -130,7 +133,7 @@ const DropZone = ({ className="text-gray-300 text-3xl mr-6" />
- Drag and drop your .env file here to add more keys. + {t("common:drop-zone-keys")}
{errorDragAndDrop ? ( @@ -150,7 +153,7 @@ const DropZone = ({ onDrop={(e) => handleDrop(e)} >Drag and drop your .env file here.
+{t("common:drop-zone")}
diff --git a/frontend/i18n.js b/frontend/i18n.js index 7be79b767..7c2945ea0 100644 --- a/frontend/i18n.js +++ b/frontend/i18n.js @@ -4,5 +4,6 @@ module.exports = { pages: { "*": ["common", "nav"], "reg:^/(login|signup)": ["auth"], + "/dashboard/[id]": ["dashboard"], }, }; diff --git a/frontend/locales/en-US/common.json b/frontend/locales/en-US/common.json index 41868c0bd..0cce1b3b0 100644 --- a/frontend/locales/en-US/common.json +++ b/frontend/locales/en-US/common.json @@ -12,5 +12,10 @@ "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." + "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." } diff --git a/frontend/locales/en-US/dashboard.json b/frontend/locales/en-US/dashboard.json new file mode 100644 index 000000000..e3b0c6ca8 --- /dev/null +++ b/frontend/locales/en-US/dashboard.json @@ -0,0 +1,10 @@ +{ + "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" +} diff --git a/frontend/pages/dashboard/[id].js b/frontend/pages/dashboard/[id].js index 42f1f81d3..c960020a3 100644 --- a/frontend/pages/dashboard/[id].js +++ b/frontend/pages/dashboard/[id].js @@ -26,7 +26,7 @@ import { faCheck, faCopy, faCircleInfo, - faX + faX, } from "@fortawesome/free-solid-svg-icons"; import ListBox from "../../components/basic/Listbox"; import DropZone from "../../components/dashboard/DropZone"; @@ -37,8 +37,18 @@ import checkUserAction from "../api/userActions/checkUserAction"; import registerUserAction from "../api/userActions/registerUserAction"; import pushKeysIntegration from "../../components/utilities/pushKeysIntegration"; import Button from "../../components/basic/buttons/Button"; +import useTranslation from "next-translate/useTranslation"; + +const KeyPair = ({ + keyPair, + deleteRow, + modifyKey, + modifyValue, + modifyVisibility, + isBlurred, +}) => { + const { t } = useTranslation(); -const KeyPair = ({ keyPair, deleteRow, modifyKey, modifyValue, modifyVisibility, isBlurred }) => { return (Secrets
- {data?.length==0 &&Project ID:
- +{`${t( + "common:project-id" + )}:`}
+Personal
++ {t("dashboard:personal")} +
Shared
++ {t("dashboard:shared")} +
+ You are not authorized to view this + project. +
)} {fileState.message == "Access needed to pull the latest file" || @@ -653,8 +728,8 @@ export default function Dashboard() { administrator for permission.- They need to grant you access in the team - tab. + They need to grant you access in + the team tab.
> ))} diff --git a/frontend/pages/signup.js b/frontend/pages/signup.js index dd5f18b7e..ce4891d41 100644 --- a/frontend/pages/signup.js +++ b/frontend/pages/signup.js @@ -270,7 +270,7 @@ export default function SignUp() {