TRAC-303: add optional options param to getByName for multi-lang support#227
Merged
bc-yevhenii-buliuk merged 1 commit intomasterfrom Mar 31, 2026
Merged
TRAC-303: add optional options param to getByName for multi-lang support#227bc-yevhenii-buliuk merged 1 commit intomasterfrom
bc-yevhenii-buliuk merged 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
790e942 to
85983d6
Compare
85983d6 to
c946c9f
Compare
jairo-bc
approved these changes
Mar 31, 2026
Contributor
|
🎉 This PR is included in version 6.21.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Jira: TRAC-303
What/Why?
This PR adds optional options param to
getByName()for multi-lang supportBigCommerce supports multi-language via URL subfolder locales (e.g.
/fr,/de).When a shopper is on
site.com/fr, AJAX requests must include the/frprefix so the server returns translated content.getByName()previously hardcoded{}as options, making it impossible to passbaseUrlfrom the theme. As a result, the country-states request was sent to
/remote/v1/country-states/{name}instead of
/fr/remote/v1/country-states/{name}, and state names were returned untranslated.Rollout/Rollback
revert the PR
Testing
trac_303_testing_on_Integration.mov
Note
Low Risk
Small, backwards-compatible change limited to request option passing plus unit tests; low risk aside from potential edge cases in argument detection.
Overview
Updates
Country.getByNameto accept an optionaloptionsargument and forward it toremoteRequest, while remaining backwards-compatible with the legacy(name, callback)signature.Adds Jest coverage to ensure the correct URL is used, options (including
baseUrlfor multi-language subfolder locales) are passed through, andundefinedoptions are handled safely.Written by Cursor Bugbot for commit c946c9f. This will update automatically on new commits. Configure here.