Skip to content

fix: replace hardcoded 'Invalid input' with localized strings#1436

Open
ArushKapoorJuspay wants to merge 1 commit intomainfrom
fix/localization-invalid-input
Open

fix: replace hardcoded 'Invalid input' with localized strings#1436
ArushKapoorJuspay wants to merge 1 commit intomainfrom
fix/localization-invalid-input

Conversation

@ArushKapoorJuspay
Copy link
Copy Markdown
Collaborator

@ArushKapoorJuspay ArushKapoorJuspay commented Mar 23, 2026

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Fixed hardcoded "Invalid input" validation error messages in card payment forms that were breaking localization for non-English users.

Problem:
Two components used hardcoded English strings instead of locale-aware text:

  • CardPayment.res (line 569): Displayed "Invalid input" when expiry validation fails in compressed layout
  • ErrorComponent.res (lines 5, 32): Displayed "Invalid input" for card field errors in compressed layout

Solution:
Replaced hardcoded strings with localeString.enterValidDetailsText:

  • CardPayment.res: Now uses localized "Please enter valid details" message
  • ErrorComponent.res: Added locale string access via Recoil and updated error display

How did you test it?

  • Ran npm run re:build - passes with 0 errors
  • Verified no hardcoded "Invalid input" strings remain in the modified files
  • Tested with German locale - now displays "Bitte geben Sie gültige Daten ein" instead of "Invalid input"

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@semanticdiff-com
Copy link
Copy Markdown

Review changes with  SemanticDiff

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Missing Linked Issue

Hi 👋 This pull request does not appear to be linked to any open issue yet.

Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.

✔️ How to fix this

  • Add a keyword like Fixes #123 or Closes #456 to your PR description or a commit message.
  • Or link it manually using the "Linked issues" panel in the PR sidebar.

Tip: You can link multiple issues.
🚫 Note: If only one issue is linked, it must be open for this check to pass.

Once linked, this check will pass automatically on your next push or when you re-run the workflow.

Thanks for helping maintainers! 🙌

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Missing Linked Issue

Hi 👋 This pull request does not appear to be linked to any open issue yet.

Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.

✔️ How to fix this

  • Add a keyword like Fixes #123 or Closes #456 to your PR description or a commit message.
  • Or link it manually using the "Linked issues" panel in the PR sidebar.

Tip: You can link multiple issues.
🚫 Note: If only one issue is linked, it must be open for this check to pass.

Once linked, this check will pass automatically on your next push or when you re-run the workflow.

Thanks for helping maintainers! 🙌

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Missing Linked Issue

Hi 👋 This pull request does not appear to be linked to any open issue yet.

Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.

✔️ How to fix this

  • Add a keyword like Fixes #123 or Closes #456 to your PR description or a commit message.
  • Or link it manually using the "Linked issues" panel in the PR sidebar.

Tip: You can link multiple issues.
🚫 Note: If only one issue is linked, it must be open for this check to pass.

Once linked, this check will pass automatically on your next push or when you re-run the workflow.

Thanks for helping maintainers! 🙌

@ArushKapoorJuspay ArushKapoorJuspay added the ai-generated PR generated by AI. Requires human review for correctness and security. label Mar 23, 2026
@aritro2002
Copy link
Copy Markdown
Contributor

🔍 Code Review by opencode

Status: ✅ Approved

Summary

Clean, focused bugfix that replaces hardcoded "Invalid input" strings with localized versions using localeString.enterValidDetailsText.

Changes Reviewed

  • ErrorComponent.res (line 32): Now uses localeString.enterValidDetailsText
  • CardPayment.res (line 569): Now uses localeString.enterValidDetailsText

Verification

  • ✅ Build passes (npm run re:build - 0 errors)
  • ✅ No hardcoded "Invalid input" strings remain in codebase
  • ✅ Follows best practices - uses existing locale infrastructure
  • ✅ No Belt modules introduced
  • ✅ No debug logs added
  • ✅ No security issues

Note

ErrorComponent.res line 27 uses Belt.Option.getWithDefault from pre-existing code (not introduced by this PR).


Reviewed by opencode AI using hyperswitch-web skill guidelines

aritro2002
aritro2002 previously approved these changes Mar 24, 2026
Replace hardcoded English validation error messages with locale-aware
strings to fix localization for non-English users.

Changes:
- CardPayment.res: Use localeString.enterValidDetailsText (line 569)
- ErrorComponent.res: Add localeString access and use localized string (lines 5, 32)

Fixes: Non-English users were seeing 'Invalid input' mixed with their
selected language when card validation failed in compressed layout.

Testing: npm run re:build passes (76ms, 0 errors)
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Missing Linked Issue

Hi 👋 This pull request does not appear to be linked to any open issue yet.

Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.

✔️ How to fix this

  • Add a keyword like Fixes #123 or Closes #456 to your PR description or a commit message.
  • Or link it manually using the "Linked issues" panel in the PR sidebar.

Tip: You can link multiple issues.
🚫 Note: If only one issue is linked, it must be open for this check to pass.

Once linked, this check will pass automatically on your next push or when you re-run the workflow.

Thanks for helping maintainers! 🙌

@aritro2002 aritro2002 linked an issue Mar 26, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated PR generated by AI. Requires human review for correctness and security.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: replace hardcoded 'Invalid input' with localized strings

2 participants