From fa0f4dd6ecf632c4013663867ebda4d220ec7cd0 Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Sun, 27 Apr 2025 13:50:40 -0400 Subject: [PATCH 1/6] - Change "Sign up via email" to "Create super admin account" - Make Terms of Service and Privacy Policy text a single translatable sentence - Add translation keys for Name and Surname fields --- client/src/Pages/Auth/Register/Register.jsx | 72 ++++++++++--------- .../src/Pages/Auth/Register/StepOne/index.jsx | 4 +- client/src/locales/gb.json | 6 +- client/src/locales/ru.json | 6 +- client/src/locales/tr.json | 6 +- 5 files changed, 51 insertions(+), 43 deletions(-) diff --git a/client/src/Pages/Auth/Register/Register.jsx b/client/src/Pages/Auth/Register/Register.jsx index 118357432..2415362ea 100644 --- a/client/src/Pages/Auth/Register/Register.jsx +++ b/client/src/Pages/Auth/Register/Register.jsx @@ -15,7 +15,7 @@ import Background from "../../../assets/Images/background-grid.svg?react"; import Logo from "../../../assets/icons/checkmate-icon.svg?react"; import Mail from "../../../assets/icons/mail.svg?react"; import "../index.css"; -import { useTranslation } from "react-i18next"; +import { useTranslation, Trans } from "react-i18next"; /** * Displays the initial landing page. * @@ -67,42 +67,44 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => { - {t("authRegisterBySigningUp")}{" "} - { - window.open( - "https://bluewavelabs.ca/terms-of-service-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { + + By creating an account, you agree to our + { + window.open( + "https://bluewavelabs.ca/terms-of-service-open-source", + "_blank", + "noreferrer" + ); + }} + sx={{ + "&:hover": { color: theme.palette.primary.contrastTextTertiary, - }, - }} - > - {t("authRegisterTerms")} - {" "} - {t("and")}{" "} - { - window.open( - "https://bluewavelabs.ca/privacy-policy-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { + }, + }} + > + Terms of Service + + and + { + window.open( + "https://bluewavelabs.ca/privacy-policy-open-source", + "_blank", + "noreferrer" + ); + }} + sx={{ + "&:hover": { color: theme.palette.primary.contrastTextTertiary, - }, - }} - > - {t("authRegisterPrivacy")} - + }, + }} + > + Privacy Policy + + diff --git a/client/src/Pages/Auth/Register/StepOne/index.jsx b/client/src/Pages/Auth/Register/StepOne/index.jsx index 4bb357e26..cb66f6704 100644 --- a/client/src/Pages/Auth/Register/StepOne/index.jsx +++ b/client/src/Pages/Auth/Register/StepOne/index.jsx @@ -64,7 +64,7 @@ function StepOne({ form, errors, onSubmit, onChange, onBack }) { > Terms of Service and <3>Privacy Policy", + "authRegisterFirstName": "Name", + "authRegisterLastName": "Surname", "distributedStatusHeaderText": "Real-time, real-device coverage", "distributedStatusSubHeaderText": "Powered by millions devices worldwide, view a system performance by global region, country or city", "settingsGeneralSettings": "General settings", diff --git a/client/src/locales/ru.json b/client/src/locales/ru.json index 5d0f649de..10ee15290 100644 --- a/client/src/locales/ru.json +++ b/client/src/locales/ru.json @@ -54,8 +54,10 @@ "authPasswordMustMatch": "должен совпадать", "authRegisterCreateAccount": "Создайте свою учетную запись, чтобы начать", "authRegisterCreateSuperAdminAccount": "Создайте учетную запись суперадминистратора, чтобы начать работу", - "authRegisterSignUpWithEmail": "Зарегистрироваться по электронной почте", - "authRegisterBySigningUp": "Регистрируясь, вы соглашаетесь с нашими", + "authRegisterSignUpWithEmail": "Создать учетную запись суперадминистратора", + "authRegisterBySigningUp": "Создавая учетную запись, вы соглашаетесь с нашими <1>Условиями использования и <3>Политикой конфиденциальности", + "authRegisterFirstName": "Имя", + "authRegisterLastName": "Фамилия", "distributedStatusHeaderText": "Охват реального времени и реального устройства", "distributedStatusSubHeaderText": "Работает на миллионах устройств по всему миру, просматривайте производительность системы по глобальному региону, стране или городу", "settingsGeneralSettings": "Общие настройки", diff --git a/client/src/locales/tr.json b/client/src/locales/tr.json index 1b759a29d..02107630e 100644 --- a/client/src/locales/tr.json +++ b/client/src/locales/tr.json @@ -54,8 +54,10 @@ "authPasswordMustMatch": "eşleşmelidir", "authRegisterCreateAccount": "Hesap oluşturmak için devam et", "authRegisterCreateSuperAdminAccount": "Super admin hesabınızı oluşturmak için devam edin", - "authRegisterSignUpWithEmail": "E-posta ile kayıt ol", - "authRegisterBySigningUp": "Kayıt olarak, aşağıdaki şartları kabul ediyorsunuz:", + "authRegisterSignUpWithEmail": "Süper yönetici hesabı oluştur", + "authRegisterBySigningUp": "Bir hesap oluşturarak, <1>Hizmet Şartlarımızı ve <3>Gizlilik Politikamızı kabul etmiş olursunuz", + "authRegisterFirstName": "Ad", + "authRegisterLastName": "Soyad", "distributedStatusHeaderText": "Gerçek zamanlı, Gerçek cihazlar kapsamı", "distributedStatusSubHeaderText": "Dünya çapında milyonlarca cihaz tarafından desteklenen sistem performansını küresel bölgeye, ülkeye veya şehre göre görüntüleyin", "settingsGeneralSettings": "Genel ayarlar", From d62a4f12fa7fd3601b3a8bd4112c674bbe5fb8f0 Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Sun, 27 Apr 2025 14:51:43 -0400 Subject: [PATCH 2/6] - Update regex pattern to use Unicode properties for better internationalization --- client/src/Validation/validation.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/client/src/Validation/validation.js b/client/src/Validation/validation.js index 6e8ff76cb..0b9088e1c 100644 --- a/client/src/Validation/validation.js +++ b/client/src/Validation/validation.js @@ -7,18 +7,11 @@ const nameSchema = joi .string() .max(50) .trim() - .pattern(/^(?=.*[\p{L}\p{Sc}])[\p{L}\p{Sc}\s']+$/u, { - name: "name.containsLetterOrSymbol", - }) - .pattern(/^[\p{L}\p{Sc}\s']+$/u, { - name: "name.validCharacters", - }) + .pattern(/^[\p{L}\p{M}''\- ]+$/u) .messages({ "string.empty": "Name is required", "string.max": "Name must be less than 50 characters", - "string.pattern.name": "Name must contain at least 1 letter or currency symbol", - "string.pattern.base.validCharacters": - "Can only contain letters, spaces, apostrophes, and currency symbols", + "string.pattern.base": "Name must contain only letters, spaces, apostrophes, or hyphens" }); const passwordSchema = joi From dae9bd42dbb3c719462b905fb6c5c1e91d661976 Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Sun, 27 Apr 2025 15:27:50 -0400 Subject: [PATCH 3/6] translatable Email" and "Email is required" --- client/src/Pages/Auth/Register/StepTwo/index.jsx | 4 ++-- client/src/locales/gb.json | 2 ++ client/src/locales/ru.json | 2 ++ client/src/locales/tr.json | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/Auth/Register/StepTwo/index.jsx b/client/src/Pages/Auth/Register/StepTwo/index.jsx index a16d5344b..d40ff161f 100644 --- a/client/src/Pages/Auth/Register/StepTwo/index.jsx +++ b/client/src/Pages/Auth/Register/StepTwo/index.jsx @@ -60,7 +60,7 @@ function StepTwo({ form, errors, onSubmit, onChange, onBack }) { (e.target.value = e.target.value.toLowerCase())} onChange={onChange} error={errors.email ? true : false} - helperText={errors.email} + helperText={errors.email && t("authRegisterEmailRequired")} ref={inputRef} /> Terms of Service and <3>Privacy Policy", "authRegisterFirstName": "Name", "authRegisterLastName": "Surname", + "authRegisterEmail": "Email", + "authRegisterEmailRequired": "Email is required", "distributedStatusHeaderText": "Real-time, real-device coverage", "distributedStatusSubHeaderText": "Powered by millions devices worldwide, view a system performance by global region, country or city", "settingsGeneralSettings": "General settings", diff --git a/client/src/locales/ru.json b/client/src/locales/ru.json index 10ee15290..026315132 100644 --- a/client/src/locales/ru.json +++ b/client/src/locales/ru.json @@ -58,6 +58,8 @@ "authRegisterBySigningUp": "Создавая учетную запись, вы соглашаетесь с нашими <1>Условиями использования и <3>Политикой конфиденциальности", "authRegisterFirstName": "Имя", "authRegisterLastName": "Фамилия", + "authRegisterEmail": "Эл. почта", + "authRegisterEmailRequired": "Эл. почта обязательна", "distributedStatusHeaderText": "Охват реального времени и реального устройства", "distributedStatusSubHeaderText": "Работает на миллионах устройств по всему миру, просматривайте производительность системы по глобальному региону, стране или городу", "settingsGeneralSettings": "Общие настройки", diff --git a/client/src/locales/tr.json b/client/src/locales/tr.json index 02107630e..463832d72 100644 --- a/client/src/locales/tr.json +++ b/client/src/locales/tr.json @@ -58,6 +58,8 @@ "authRegisterBySigningUp": "Bir hesap oluşturarak, <1>Hizmet Şartlarımızı ve <3>Gizlilik Politikamızı kabul etmiş olursunuz", "authRegisterFirstName": "Ad", "authRegisterLastName": "Soyad", + "authRegisterEmail": "E-posta", + "authRegisterEmailRequired": "E-posta gereklidir", "distributedStatusHeaderText": "Gerçek zamanlı, Gerçek cihazlar kapsamı", "distributedStatusSubHeaderText": "Dünya çapında milyonlarca cihaz tarafından desteklenen sistem performansını küresel bölgeye, ülkeye veya şehre göre görüntüleyin", "settingsGeneralSettings": "Genel ayarlar", From 449dd36f910b6a63d305008bab287e395c9f9f5e Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Sun, 27 Apr 2025 15:33:03 -0400 Subject: [PATCH 4/6] Use an existing translation key "authLoginEnterPassword": "Enter your password" --- client/src/Pages/Auth/Register/StepThree/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/Pages/Auth/Register/StepThree/index.jsx b/client/src/Pages/Auth/Register/StepThree/index.jsx index eb05f843a..1af8a60dc 100644 --- a/client/src/Pages/Auth/Register/StepThree/index.jsx +++ b/client/src/Pages/Auth/Register/StepThree/index.jsx @@ -64,7 +64,7 @@ function StepThree({ onSubmit, onBack }) { type="password" id="register-password-input" name="password" - label={t("commonPassword")} + label={t("authLoginEnterPassword")} isRequired={true} placeholder={t("createAPassword")} autoComplete="current-password" From 9061039df8e850abd7e5352c0c8fc0ef1fd59353 Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Sun, 27 Apr 2025 15:42:05 -0400 Subject: [PATCH 5/6] update the capitalization in the "authRegisterCreateSuperAdminAccount" key to be consistent --- client/src/locales/gb.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/locales/gb.json b/client/src/locales/gb.json index 2615570e4..25d6c0a4f 100644 --- a/client/src/locales/gb.json +++ b/client/src/locales/gb.json @@ -53,7 +53,7 @@ "authPasswordConfirmAndPassword": "Confirm password and password", "authPasswordMustMatch": "must match", "authRegisterCreateAccount": "Create your account to get started", - "authRegisterCreateSuperAdminAccount": "Create your Super admin account to get started", + "authRegisterCreateSuperAdminAccount": "Create your super admin account to get started", "authRegisterSignUpWithEmail": "Create super admin account", "authRegisterBySigningUp": "By creating an account, you agree to our <1>Terms of Service and <3>Privacy Policy", "authRegisterFirstName": "Name", From a15c5635dbd279f6c9161d140fb343a31d67088f Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Mon, 28 Apr 2025 22:48:09 -0400 Subject: [PATCH 6/6] some modification --- client/src/Pages/Auth/Register/Register.jsx | 79 +++++++++++---------- client/src/locales/gb.json | 2 +- client/src/locales/ru.json | 2 +- client/src/locales/tr.json | 2 +- 4 files changed, 44 insertions(+), 41 deletions(-) diff --git a/client/src/Pages/Auth/Register/Register.jsx b/client/src/Pages/Auth/Register/Register.jsx index 2415362ea..6617357e8 100644 --- a/client/src/Pages/Auth/Register/Register.jsx +++ b/client/src/Pages/Auth/Register/Register.jsx @@ -67,44 +67,47 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => { - - By creating an account, you agree to our - { - window.open( - "https://bluewavelabs.ca/terms-of-service-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { - color: theme.palette.primary.contrastTextTertiary, - }, - }} - > - Terms of Service - - and - { - window.open( - "https://bluewavelabs.ca/privacy-policy-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { - color: theme.palette.primary.contrastTextTertiary, - }, - }} - > - Privacy Policy - - + { + window.open( + "https://bluewavelabs.ca/terms-of-service-open-source", + "_blank", + "noreferrer" + ); + }} + /> + ), + a2: ( + { + window.open( + "https://bluewavelabs.ca/privacy-policy-open-source", + "_blank", + "noreferrer" + ); + }} + /> + ) + }} + /> diff --git a/client/src/locales/gb.json b/client/src/locales/gb.json index 25d6c0a4f..96c123b91 100644 --- a/client/src/locales/gb.json +++ b/client/src/locales/gb.json @@ -55,7 +55,7 @@ "authRegisterCreateAccount": "Create your account to get started", "authRegisterCreateSuperAdminAccount": "Create your super admin account to get started", "authRegisterSignUpWithEmail": "Create super admin account", - "authRegisterBySigningUp": "By creating an account, you agree to our <1>Terms of Service and <3>Privacy Policy", + "authRegisterBySigningUp": "By creating an account, you agree to our Terms of Service and Privacy Policy.", "authRegisterFirstName": "Name", "authRegisterLastName": "Surname", "authRegisterEmail": "Email", diff --git a/client/src/locales/ru.json b/client/src/locales/ru.json index 026315132..520d34826 100644 --- a/client/src/locales/ru.json +++ b/client/src/locales/ru.json @@ -55,7 +55,7 @@ "authRegisterCreateAccount": "Создайте свою учетную запись, чтобы начать", "authRegisterCreateSuperAdminAccount": "Создайте учетную запись суперадминистратора, чтобы начать работу", "authRegisterSignUpWithEmail": "Создать учетную запись суперадминистратора", - "authRegisterBySigningUp": "Создавая учетную запись, вы соглашаетесь с нашими <1>Условиями использования и <3>Политикой конфиденциальности", + "authRegisterBySigningUp": "Создавая учетную запись, вы соглашаетесь с нашими Условиями использования и Политикой конфиденциальности.", "authRegisterFirstName": "Имя", "authRegisterLastName": "Фамилия", "authRegisterEmail": "Эл. почта", diff --git a/client/src/locales/tr.json b/client/src/locales/tr.json index 463832d72..2fd16829d 100644 --- a/client/src/locales/tr.json +++ b/client/src/locales/tr.json @@ -55,7 +55,7 @@ "authRegisterCreateAccount": "Hesap oluşturmak için devam et", "authRegisterCreateSuperAdminAccount": "Super admin hesabınızı oluşturmak için devam edin", "authRegisterSignUpWithEmail": "Süper yönetici hesabı oluştur", - "authRegisterBySigningUp": "Bir hesap oluşturarak, <1>Hizmet Şartlarımızı ve <3>Gizlilik Politikamızı kabul etmiş olursunuz", + "authRegisterBySigningUp": "Bir hesap oluşturarak, Hizmet Şartlarımızı ve Gizlilik Politikamızı kabul etmiş olursunuz.", "authRegisterFirstName": "Ad", "authRegisterLastName": "Soyad", "authRegisterEmail": "E-posta",