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! 🙌 |
1 similar comment
🚫 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! 🙌 |
71cb524 to
f9ade03
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! 🙌 |
1 similar comment
🚫 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! 🙌 |
f9ade03 to
9d98345
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! 🙌 |
9d98345 to
47504fb
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! 🙌 |
🚫 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! 🙌 |
2 similar comments
🚫 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! 🙌 |
1 similar comment
🚫 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! 🙌 |
1 similar comment
🚫 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! 🙌 |
| customMessageForCardTerms | ||
| } else { | ||
| localeString.cardTerms(business.name) | ||
| localeString.cardTermsPart1 ++ business.name ++ localeString.cardTermsPart2 |
There was a problem hiding this comment.
please write it using string templates
There was a problem hiding this comment.
We tried implementing it using string templates but some string interpolations like surchargeMsgAmount require rendering parts of the text in bold, which involves platform-specific React logic. Since the locale utils are shared between the web and mobile SDKs, adding such rendering logic there isn't feasible.
Because of outliers like this, abstracting string interpolation into shared util functions would be inconsistent — we'd have utils for some cases but not others.
Also, locale strings were split into parts so that consumers can freely decide how to join and display them. Adding a shared util that does the joining for them would defeat that purpose.
I see that you've split several strings into multiple parts (e.g., cardTerms1 and cardTerms2) and are manually concatenating them everywhere using templates like ${cardTerms1}${someValue}${cardTerms2}. The problem with this approach is that it leads to repeated hard-coded logic across multiple files. If something changes in the future, we won’t know which files need to be updated, and this can easily introduce inconsistencies. Instead, it would be better to create a reusable utility function that handles this logic in one place. This way, we can simply call the function wherever needed, making the code cleaner, easier to maintain, and less error-prone. |
| { | ||
| context: ["/assets/v2/jsons/locales/"], | ||
| target: "https://beta.hyperswitch.io", | ||
| changeOrigin: true, | ||
| secure: true, | ||
| pathRewrite: { | ||
| "^/assets/v2/jsons/locales/": "/assets/v2/jsons/locales/", | ||
| }, | ||
| }, |
There was a problem hiding this comment.
There's no need to add this piece of code to the webpack dev configuration — just keep the target empty; the rest can remain as it is. This is only needed for local testing.
There was a problem hiding this comment.
Yes, we'll need this for local testing by creating a proxy to sandbox.
just keep the target empty
Didn't get this. Can you please explain
There was a problem hiding this comment.
I meant that we should not hard-code the target URL in the proxy config. Since this is only for local development, anyone who is testing can set their own URL(integ, sbx,prod) if needed. There’s no point in pushing a fixed sandbox or beta endpoint into the public repo.
So instead of keeping "https://beta.hyperswitch.io" in the config, we should leave the target field empty, and developers can fill it locally while testing.
| let json = await response->Fetch.Response.json | ||
| let localeStrings = LocaleUtils.getLocaleStringsFromJson(json) | ||
| Console.log2("-- Locale strings fetched from S3: ", localeStrings) | ||
| localeStrings | ||
| } else { | ||
| raise(Exn.raiseError("Failed to fetch locale")) | ||
| } | ||
| } |
There was a problem hiding this comment.
Instead of using console.log, please use the logger as used in the API calls in the paymentHelpers.res file
There was a problem hiding this comment.
yeah, mb, thanks. Missed the log statement here by mistake
There was a problem hiding this comment.
removed the log statement
| | Some(Ca) => "ca" | ||
| // | Some(Zh) => "zh" // Pending support | ||
| | Some(Pt) => "pt" | ||
| | Some(It) => "it" | ||
| | Some(Pl) => "pl" | ||
| | Some(Nl) => "nl" | ||
| | Some(NI_BE) => "nl-BE" // to check | ||
| | Some(Sv) => "sv" | ||
| | Some(Ru) => "ru" | ||
| // | Some(Zh_HANT) => "zh-Hant" // Pending support | ||
| | Some(Lt) => "lt" |
There was a problem hiding this comment.
zh and zh-Hant is used my merchants on prod
There was a problem hiding this comment.
yes will add this in a stacked PR, working on that
There was a problem hiding this comment.
src/Components/SurchargeUtils.res
Outdated
| } else if index === oneClickWalletsArr->Array.length - 1 { | ||
| <> | ||
| {React.string(`${Utils.nbsp}${localeString.\"and"}${Utils.nbsp}`)} | ||
| {React.string(`${Utils.nbsp}${localeString.and_}${Utils.nbsp}`)} |
There was a problem hiding this comment.
why did you change the type \"and" to and_?
There was a problem hiding this comment.
will revert this
There was a problem hiding this comment.
removed this change
🚫 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! 🙌 |
1 similar comment
🚫 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
This change aims to usage of locales from
shared-code-utilsand hosted as a common resource on s3.Related changes at shared-code-utils here: https://github.com/juspay/hyperswitch-sdk-utils/pull/41/changes.
Changed
The locales will be consumed from shared-code and fetched from s3 at runtime for required language. Default english locale files are shipped along with the bundle.
Motivation
By this change, we aim to conform to a single source of truth for all the texts appeared on ui to behave the same across all the sdks/ platforms.
STACKED PRs
How did you test it?
fix-locale-selection.Screenshots / Recordings
Screen.Recording.2026-02-23.at.4.27.51.PM.mov
Checklist
npm run re:build