fix: replace hardcoded 'Invalid input' with localized strings#1436
fix: replace hardcoded 'Invalid input' with localized strings#1436ArushKapoorJuspay wants to merge 1 commit intomainfrom
Conversation
🚫 Missing Linked IssueHi 👋 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
Once linked, this check will pass automatically on your next push or when you re-run the workflow. Thanks for helping maintainers! 🙌 |
🚫 Missing Linked IssueHi 👋 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
Once linked, this check will pass automatically on your next push or when you re-run the workflow. Thanks for helping maintainers! 🙌 |
🚫 Missing Linked IssueHi 👋 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
Once linked, this check will pass automatically on your next push or when you re-run the workflow. Thanks for helping maintainers! 🙌 |
🔍 Code Review by opencodeStatus: ✅ Approved SummaryClean, focused bugfix that replaces hardcoded "Invalid input" strings with localized versions using localeString.enterValidDetailsText. Changes Reviewed
Verification
NoteErrorComponent.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 |
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)
3b5b7de to
37e8166
Compare
🚫 Missing Linked IssueHi 👋 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
Once linked, this check will pass automatically on your next push or when you re-run the workflow. Thanks for helping maintainers! 🙌 |
Type of Change
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 layoutErrorComponent.res(lines 5, 32): Displayed "Invalid input" for card field errors in compressed layoutSolution:
Replaced hardcoded strings with
localeString.enterValidDetailsText:CardPayment.res: Now uses localized "Please enter valid details" messageErrorComponent.res: Added locale string access via Recoil and updated error displayHow did you test it?
npm run re:build- passes with 0 errorsChecklist
npm run re:build