Skip to content

Commit

Permalink
reuse existing translations
Browse files Browse the repository at this point in the history
  • Loading branch information
rajku-dev committed Jan 7, 2025
1 parent 84dafdb commit 3bb013c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1338,10 +1338,6 @@
"password_length_validation": "Password must be at least 8 characters long",
"password_lowercase_validation": "Password must contain at least one lowercase letter (a-z)",
"password_mismatch": "New password and confirm password must be the same.",
"password_must_be_at_least_8_characters": "Password must be at least 8 characters",
"password_must_contain_lowercase": "Password must contain at least one lowercase letter",
"password_must_contain_number": "Password must contain at least one number",
"password_must_contain_uppercase": "Password must contain at least one uppercase letter",
"password_number_validation": "Password must contain at least one number (0-9)",
"password_required": "Password is required",
"password_reset_failure": "Password Reset Failed",
Expand All @@ -1350,7 +1346,6 @@
"password_update_error": "Error while updating password. Try again later.",
"password_uppercase_validation": "Password must contain at least one uppercase letter (A-Z)",
"password_validation": "Password must contain at least: 8 characters, 1 uppercase letter (A-Z), 1 lowercase letter (a-z), and 1 number (0-9)",
"passwords_do_not_match": "Passwords don't match",
"patient": "Patient",
"patient-notes": "Notes",
"patient__general-info": "General Info",
Expand Down
10 changes: 5 additions & 5 deletions src/components/Users/CreateUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export default function CreateUserForm({ onSubmitSuccess }: Props) {
),
password: z
.string()
.min(8, t("password_must_be_at_least_8_characters"))
.regex(/[a-z]/, t("password_must_contain_lowercase"))
.regex(/[A-Z]/, t("password_must_contain_uppercase"))
.regex(/[0-9]/, t("password_must_contain_number")),
.min(8, t("password_length_validation"))
.regex(/[a-z]/, t("password_lowercase_validation"))
.regex(/[A-Z]/, t("password_uppercase_validation"))
.regex(/[0-9]/, t("password_number_validation")),
c_password: z.string(),
first_name: z.string().min(1, t("this_field_is_required")),
last_name: z.string().min(1, t("this_field_is_required")),
Expand All @@ -85,7 +85,7 @@ export default function CreateUserForm({ onSubmitSuccess }: Props) {
geo_organization: z.string().min(1, t("this_field_is_required")),
})
.refine((data) => data.password === data.c_password, {
message: t("passwords_do_not_match"),
message: t("password_mismatch"),
path: ["c_password"],
});

Expand Down

0 comments on commit 3bb013c

Please sign in to comment.