From 9fda8cadba24259d03c07a847030c3d5bf102b8a Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Mon, 17 Nov 2025 20:51:57 +0100 Subject: [PATCH] Internationalize validation error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced hardcoded "Validation failed" message with translated version from language files: - Updated userProfileActions.ts to use t("validation-failed") - Added translations in English and Croatian - Reordered general-error div in AccountForm for better layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/lib/actions/userProfileActions.ts | 2 +- app/ui/AccountForm.tsx | 16 ++++++++-------- messages/en.json | 3 ++- messages/hr.json | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/lib/actions/userProfileActions.ts b/app/lib/actions/userProfileActions.ts index 381abbc..6ba6484 100644 --- a/app/lib/actions/userProfileActions.ts +++ b/app/lib/actions/userProfileActions.ts @@ -77,7 +77,7 @@ export const updateUserProfile = withUser(async (user: AuthenticatedUser, prevSt if (!validatedFields.success) { return { errors: validatedFields.error.flatten().fieldErrors, - message: "Validation failed", + message: t("validation-failed"), success: false, }; } diff --git a/app/ui/AccountForm.tsx b/app/ui/AccountForm.tsx index d6e318a..d86ad0e 100644 --- a/app/ui/AccountForm.tsx +++ b/app/ui/AccountForm.tsx @@ -143,14 +143,6 @@ const FormFields: FC = ({ profile, errors, message }) => { -
- {message && ( -

- {message} -

- )} -
- {hasMissingData && (
@@ -160,6 +152,14 @@ const FormFields: FC = ({ profile, errors, message }) => {
)} +
+ {message && ( +

+ {message} +

+ )} +
+