Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use context i18n data automatically with customer account api login #2746

Merged
merged 18 commits into from
Feb 12, 2025

Conversation

ruggishop
Copy link
Contributor

@ruggishop ruggishop commented Feb 10, 2025

WHY are these changes introduced?

The URL generated by the login method of CustomerAccount can receive a uiLocales param used to localize the login page; however it should be possible to pass localization data to the constructor of the CustomerAccount itself, making it less easy to forget.

WHAT is this pull request doing?

  1. Pass the language hydrogen context data (from i18n) to createCustomerAccountClient
  2. Refactor the ui_locales param building so that it uses the context locale data, overriding it with the data in options.uiLocales is present.

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

Copy link
Contributor

shopify bot commented Feb 10, 2025

Oxygen deployed a preview of your feat/fr-customer-login-locale branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment February 12, 202511:09 AM
metaobjects ✅ Successful (Logs) Preview deployment Inspect deployment February 12, 202511:08 AM
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment February 12, 202511:08 AM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment February 12, 202511:08 AM
classic-remix ✅ Successful (Logs) Preview deployment Inspect deployment February 12, 202511:09 AM

Learn more about Hydrogen's GitHub integration.

@wizardlyhel wizardlyhel self-requested a review February 10, 2025 17:24
@ruggishop ruggishop marked this pull request as ready for review February 11, 2025 11:10
@ruggishop ruggishop merged commit 6bff6b6 into main Feb 12, 2025
12 checks passed
@ruggishop ruggishop deleted the feat/fr-customer-login-locale branch February 12, 2025 11:15
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.

4 participants