From af7fd27bbf71cc831cc7d8f3c119704eb598c1f9 Mon Sep 17 00:00:00 2001 From: Eduard Bissell Date: Thu, 15 Feb 2024 16:42:58 +0000 Subject: [PATCH 1/2] feat: add translation to component --- src/locales/en/translation.json | 8 ++++++-- src/locales/se/translation.json | 8 ++++++-- src/pages/verification/index.js | 13 +++++++------ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index eac825ba..d3960885 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -79,5 +79,9 @@ "units": "Units", "uploadValidImage": "Please upload a valid image file", "welcome": "Welcome to Cohort Manager", - "whatsOnYourMind": "What's on your mind?" -} \ No newline at end of file + "whatsOnYourMind": "What's on your mind?", + "emailSent": "We have sent you a verification email to check and confirm your email address.", + "followLinkToLogin": "Please follow the link in the email to log in to Cohort Manager.", + "resendEmail": "Resend email", + "continue": "Continue" +} diff --git a/src/locales/se/translation.json b/src/locales/se/translation.json index 69757cbd..404b0524 100644 --- a/src/locales/se/translation.json +++ b/src/locales/se/translation.json @@ -79,5 +79,9 @@ "units": "Enheter", "uploadValidImage": "Ladda upp en giltig bildfil", "welcome": "Välkommen till Cohort Manager", - "whatsOnYourMind": "Vad tänker du på?" -} \ No newline at end of file + "whatsOnYourMind": "Vad tänker du på?", + "emailSent": "Vi har skickat en verifierings-e-post till dig för att kontrollera och bekräfta din e-postadress.", + "followLinkToLogin": "Följ länken i e-postmeddelandet för att logga in på Cohort Manager.", + "resendEmail": "Skicka e-post igen", + "continue": "Fortsätt" +} diff --git a/src/pages/verification/index.js b/src/pages/verification/index.js index 240f8b24..d80137a9 100644 --- a/src/pages/verification/index.js +++ b/src/pages/verification/index.js @@ -2,9 +2,11 @@ import Button from "../../components/button"; import TickIcon from "../../assets/tickIcon"; import "./verification.css"; import { useNavigate } from "react-router-dom"; +import { useTranslation } from "react-i18next"; const Verification = () => { const navigate = useNavigate(); + const { t } = useTranslation(); const onContinueClick = () => { navigate("/welcome"); @@ -14,20 +16,19 @@ const Verification = () => {
-

Welcome to Cohort Manager

+

{t("welcome")}

- We have sent you a verification email to check and confirm your - email address. + {t("emailSent")}


- Please follow the link in the email to log in to Cohort Manager. + {t("followLinkToLogin")}

-
From d19ba79417fc2b39bedf57ca93f1673912f5a9f6 Mon Sep 17 00:00:00 2001 From: Eduard Bissell Date: Thu, 15 Feb 2024 16:44:30 +0000 Subject: [PATCH 2/2] refactor: reorder translations --- src/locales/en/translation.json | 12 ++++++------ src/locales/se/translation.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index d3960885..a60cda20 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -16,6 +16,7 @@ "cohort": "Cohort", "comment": "Comment", "contactInfo": "Contact Info", + "continue": "Continue", "countAndCompleted": "{{completedTasks}}/{{totalTasks}} completed", "createAPost": "Create a post", "createProfile": "Create Profile", @@ -27,6 +28,7 @@ "editSearch": "No results", "editYourPost": "Edit your post", "email": "Email", + "emailSent": "We have sent you a verification email to check and confirm your email address.", "enterCharacter": "Enter 3 characters or more", "enterYourFirstName": "enter your first name", "enterYourGithubUser": "enter your github username", @@ -37,6 +39,7 @@ "failedToEditPost": "Failed to edit the post. Please try again.", "firstLike": "Be the first to like this", "firstName": "First name", + "followLinkToLogin": "Please follow the link in the email to log in to Cohort Manager.", "frontendDevelopment": "Frontend Development", "getStarted": "Create your profile to get started", "githubUserName": "Github Username", @@ -67,6 +70,7 @@ "profile": "Profile", "required": "Required", "requiredFields": "Required fields need to be complete", + "resendEmail": "Resend email", "searchResults": "Search Results", "seeExercises": "See Exercises", "sendMessage": "send message", @@ -79,9 +83,5 @@ "units": "Units", "uploadValidImage": "Please upload a valid image file", "welcome": "Welcome to Cohort Manager", - "whatsOnYourMind": "What's on your mind?", - "emailSent": "We have sent you a verification email to check and confirm your email address.", - "followLinkToLogin": "Please follow the link in the email to log in to Cohort Manager.", - "resendEmail": "Resend email", - "continue": "Continue" -} + "whatsOnYourMind": "What's on your mind?" +} \ No newline at end of file diff --git a/src/locales/se/translation.json b/src/locales/se/translation.json index 404b0524..d9cff1f8 100644 --- a/src/locales/se/translation.json +++ b/src/locales/se/translation.json @@ -16,6 +16,7 @@ "cohort": "Kohort", "comment": "Kommentera", "contactInfo": "Contact Info", + "continue": "Fortsätt", "countAndCompleted": "Klar {{completedTasks}}/{{totalTasks}}", "createAPost": "Skapa ett inlägg", "createProfile": "Skapa profil", @@ -27,6 +28,7 @@ "editSearch": "Inga resultat", "editYourPost": "Redigera ditt inlägg", "email": "E-post", + "emailSent": "Vi har skickat en verifierings-e-post till dig för att kontrollera och bekräfta din e-postadress.", "enterCharacter": "Ange 3 eller fler tecken", "enterYourFirstName": "Ange ditt förnamn", "enterYourGithubUser": "Ange ditt GitHub-användarnamn", @@ -37,6 +39,7 @@ "failedToEditPost": "Misslyckades att redigera inlägget. Försök igen.", "firstLike": "Var den första att gilla detta", "firstName": "Förnamn", + "followLinkToLogin": "Följ länken i e-postmeddelandet för att logga in på Cohort Manager.", "frontendDevelopment": "Frontendutveckling", "getStarted": "Skapa din profil för att komma igång", "githubUserName": "Github-användarnamn", @@ -67,6 +70,7 @@ "profile": "Profil", "required": "Obligatorisk", "requiredFields": "Fyll i alla obligatoriska fält", + "resendEmail": "Skicka e-post igen", "searchResults": "Sökresultat", "seeExercises": "Visa övningar", "sendMessage": "Skicka meddelande", @@ -79,9 +83,5 @@ "units": "Enheter", "uploadValidImage": "Ladda upp en giltig bildfil", "welcome": "Välkommen till Cohort Manager", - "whatsOnYourMind": "Vad tänker du på?", - "emailSent": "Vi har skickat en verifierings-e-post till dig för att kontrollera och bekräfta din e-postadress.", - "followLinkToLogin": "Följ länken i e-postmeddelandet för att logga in på Cohort Manager.", - "resendEmail": "Skicka e-post igen", - "continue": "Fortsätt" -} + "whatsOnYourMind": "Vad tänker du på?" +} \ No newline at end of file