Internationalize validation error message
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -143,14 +143,6 @@ const FormFields: FC<FormFieldsProps> = ({ profile, errors, message }) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="general-error" aria-live="polite" aria-atomic="true">
|
||||
{message && (
|
||||
<p className="mt-2 text-sm text-red-500">
|
||||
{message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{hasMissingData && (
|
||||
<div className="alert mt-4 max-w-md flex flex-row items-start">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" className="stroke-current shrink-0 w-6 h-6">
|
||||
@@ -160,6 +152,14 @@ const FormFields: FC<FormFieldsProps> = ({ profile, errors, message }) => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div id="general-error" aria-live="polite" aria-atomic="true">
|
||||
{message && (
|
||||
<p className="mt-2 text-sm text-red-500">
|
||||
{message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="pt-4">
|
||||
<button className="btn btn-primary w-[5.5em]" disabled={pending}>
|
||||
{pending ? (
|
||||
|
||||
Reference in New Issue
Block a user