Skip to content

fix: Translate MFA error messages and placeholders#2196

Merged
sricharan-varanasi merged 2 commits intodevelopfrom
mfa-french-fixes
Feb 26, 2026
Merged

fix: Translate MFA error messages and placeholders#2196
sricharan-varanasi merged 2 commits intodevelopfrom
mfa-french-fixes

Conversation

@sricharan-varanasi
Copy link
Contributor

@sricharan-varanasi sricharan-varanasi commented Jan 29, 2026

  • Tests for the changes have been added (existing tests pass)
  • Related documentation has been added / updated
  • OSS packages added to Curious open source credit page
  • Delivered the fix or feature branches into develop or release branches via Squash and Merge (to keep clean history)

📝 Description

🔗 Jira Ticket M2-10397
🔗 Jira Ticket M2-10399
🔗 Jira Ticket M2-10400

Fixed MFA flows (setup, disable, and view recovery codes) to properly display French translations for placeholder text and error messages when the application language is changed to French.

Changes include:

  • MFAVerificationForm: Added translation wrapper to error display using t(error, { defaultValue: error })
  • Error Constants: Converted all hardcoded English error messages to translation keys:
    • MFASetup.const.ts: Updated error messages to use keys like invalidMFACode, mfaSessionExpired, networkError
    • RemoveMFA.constants.ts: Updated error messages to use keys like invalidRecoveryCode, recoveryCodeAlreadyUsed, tooManyAttempts
    • ViewRecoveryCodes.utils.ts: Updated error messages to use translation keys
  • Translation Files: Added new mfaAlreadyEnabled translation key in both app-en.json and app-fr.json
  • ViewRecoveryCodes Hook: Fixed two hardcoded "Session expired. Please try again." messages to use mfaSessionExpired translation key
  • Identity Confirmation Components: Ensured ConfirmIdentityVerificationCode and ConfirmIdentityRecoveryCode properly translate errors

🪤 Peer Testing

  1. Log in to the application

  2. Navigate to Account Settings → MFA section

  3. Change language to French using the language selector

  4. Enable MFA and enter an incorrect verification code

    Expected outcome: Error message should appear in French: "Code de vérification invalide"

  5. Try to view recovery codes with an incorrect code

    Expected outcome: Error message should appear in French: "Code invalide"

  6. Try to disable MFA with an incorrect recovery code

    Expected outcome: Error message should appear in French: "Code de récupération invalide"

  7. Wait for session to expire during any MFA flow

    Expected outcome: Error message should appear in French: "Votre session a expiré. Veuillez vous reconnecter."

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2196.d2ccder08v9rmu.amplifyapp.com

@sricharan-varanasi sricharan-varanasi force-pushed the mfa-french-fixes branch 3 times, most recently from 2ad8a7d to 3ba413c Compare January 30, 2026 01:27
Copy link
Contributor

@divbzero divbzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small copy-paste error. Otherwise looks good!

@sricharan-varanasi sricharan-varanasi merged commit b004e56 into develop Feb 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants