From 4a1dff5f1204aadbb59229b5782cfd3224cab278 Mon Sep 17 00:00:00 2001 From: Daniel Jakab Date: Wed, 27 Nov 2024 14:28:52 +0100 Subject: [PATCH] Change AccountID->ParticipantID, StudyProtocol->Protocol version, InformedConsent->ConsentDocument --- .vscode/settings.json | 2 +- src/i18n.ts | 2 +- src/pages/Participant/BasicInfo/index.tsx | 18 +++++++++++++----- src/pages/Protocol/ProtocolInfo/index.tsx | 2 +- src/pages/Resources/AddResourceModal/index.tsx | 2 +- src/public/locales/en/common.json | 3 ++- src/public/locales/en/participant.json | 5 +++++ 7 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 src/public/locales/en/participant.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ee26bf..594c4ac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ "source.fixAll.eslint": "explicit" }, "i18n-ally.localesPaths": [ - "src/locales" + "src/public/locales", ], "i18n-ally.keystyle": "nested", } \ No newline at end of file diff --git a/src/i18n.ts b/src/i18n.ts index 1ae33e8..2f9d5d6 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -9,7 +9,7 @@ i18n supportedLngs: ["en", "da"], lng: "en", fallbackLng: "en", - ns: ["common", "error", "deployment"], + ns: ["common", "error", "deployment", "participant"], backend: { loadPath: "/locales/{{lng}}/{{ns}}.json", }, diff --git a/src/pages/Participant/BasicInfo/index.tsx b/src/pages/Participant/BasicInfo/index.tsx index 7efb556..87ba767 100644 --- a/src/pages/Participant/BasicInfo/index.tsx +++ b/src/pages/Participant/BasicInfo/index.tsx @@ -10,6 +10,7 @@ import NotificationsIcon from "@mui/icons-material/NotificationsSharp"; import { getUser } from "@carp-dk/authentication-react"; import { useStudyDetails } from "@Utils/queries/studies"; +import { useTranslation } from "react-i18next"; import { AccountIcon, Email, @@ -26,6 +27,7 @@ import { import LoadingSkeleton from "../LoadingSkeleton"; const BasicInfo = () => { + const { t } = useTranslation(); const [open, setOpen] = useState(false); const { participantId, deploymentId, id: studyId } = useParams(); @@ -109,13 +111,19 @@ const BasicInfo = () => { {name} {participant.email} - {!isGeneratedAccount && setOpen(true)}> - Send a reminder - - } + {!isGeneratedAccount && ( + setOpen(true)}> + + {t("participant:basic_info.send_reminder")} + + + + )} - Account ID: {participantId} + + {t("common:participant_id", { participantId })} + { - Study protocol v{protocol.versionTag} + Current version: {protocol.versionTag} Update the Protocol data by adding a new version diff --git a/src/pages/Resources/AddResourceModal/index.tsx b/src/pages/Resources/AddResourceModal/index.tsx index 6f32002..73fe563 100644 --- a/src/pages/Resources/AddResourceModal/index.tsx +++ b/src/pages/Resources/AddResourceModal/index.tsx @@ -29,7 +29,7 @@ interface Props { } const resourceTypes = { - "Informed Consent": "informed_consent", + "Consent Document": "informed_consent", }; const validationSchema = yup.object({ diff --git a/src/public/locales/en/common.json b/src/public/locales/en/common.json index 95f1c70..57882ac 100644 --- a/src/public/locales/en/common.json +++ b/src/public/locales/en/common.json @@ -11,5 +11,6 @@ "deploy": "Deploy", "last_data_zero": "Last data: Today", "last_data_one": "Last data: {{count}} day ago", - "last_data_other": "Last data: {{count}} days ago" + "last_data_other": "Last data: {{count}} days ago", + "participant_id": "Participant ID: {{participantId}}" } diff --git a/src/public/locales/en/participant.json b/src/public/locales/en/participant.json new file mode 100644 index 0000000..32f5435 --- /dev/null +++ b/src/public/locales/en/participant.json @@ -0,0 +1,5 @@ +{ + "basic_info": { + "send_reminder": "Send a reminder" + } +}