feat: add i18n support to My Account components#3270
Draft
caetano-vtex wants to merge 1 commit intodevfrom
Draft
feat: add i18n support to My Account components#3270caetano-vtex wants to merge 1 commit intodevfrom
caetano-vtex wants to merge 1 commit intodevfrom
Conversation
Introduce react-intl-based internationalization across all My Account components, including new LocaleSelector, MyAccountIntlProvider, and locale message files for en-US and pt-BR. Made-with: Cursor
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Introduce react-intl-based internationalization across all My Account components, including new LocaleSelector, MyAccountIntlProvider, and locale message files for en-US and pt-BR.
Made-with: Cursor
What's the purpose of this pull request?
My Account components had all user-facing strings hardcoded in English, making it impossible to serve shoppers in other languages. This PR lays the i18n foundation for the My Account area — enabling merchants to reach customers in their native language, starting with English and Brazilian Portuguese.
How it works?
This PR introduces a
react-intl-based internationalization layer wrapping the entire My Account section:MyAccountIntlProvider— a context provider that wraps all My Account components withreact-intl'sIntlProvider. It reads the active locale from auseMyAccountLocalehook and resolves the matching message bundle (en-USorpt-BR), falling back to English when no match is found.LocaleSelector— a native<select>component (with adata-fs-locale-selectorattribute for styling) that lets users switch between supported locales at runtime. It is rendered insideMyAccountHeader.en-US.jsonandpt-BR.json) covering all translatable strings across the My Account area: navigation menu, profile, security, orders list, order details (status, summary, payment, delivery, budgets, buying policy alerts), and user details.useIntl().formatMessage()instead of hardcoded literals, covering components such asMyAccountListOrders,MyAccountOrderDetails,MyAccountStatusCard,MyAccountBuyingPolicyAlert,MyAccountPaymentCard, and more.How to test it?
Starters Deploy Preview
NA
References
Checklist
PR Title and Commit Messages
feat,fix,chore,docs,style,refactor,ciandtestPR Description
breaking change,bug,contributing,performance,documentation..Dependencies
pnpm-lock.yamlfile when there were changes to the packagesDocumentation
@Mariana-Caetanoto review and update (Or submit a doc request)