Skip to content

feat: Enables localization feature - #3093

Merged
lemagnetic merged 56 commits into
canary-v2from
feat/multilanguage
Mar 5, 2026
Merged

lemagnetic merged 56 commits into
canary-v2from
feat/multilanguage

Conversation

@hellofanny

@hellofanny hellofanny commented Nov 3, 2025 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

Removing hardcoded labels:

Setting Up locales

Components

Fetching content

Others

How to test locally?

  • Run pnpm I (install all the new dependencies and needed packages)
  • If you want to try localization feature, go to/discovery.config.default.js:
    Enable localization:
localization: {
  enabled: true
}
  • Run node packages/cli/bin/run.js generate-i18n ./packages/core to fetch the bindings

If the contentSource is not set to content platform yet, you will see a message to update to it.

contentSource: {
type: 'CP',
},

⚠️ Note: Ensure the url is set to localhost for local testing. These locale bindings are generated in discovery.config after running the generate-i18n command.

localization: {
  enabled: true,
  defaultLocale: 'en-US',
   regions: {...},
    locales: {
      'pt-BR': {
           ...
        bindings: [
          {
            currencyCode: 'BRL',
-           url: 'https://brandless.fast.store/pt-BR',
+           url: 'http://localhost:3000/pt-BR',
            salesChannel: '2',
            isDefault: true,
            locales: [
              {
                code: 'pt-BR',
                isDefault: true,
              },
            ],
          },
        ],
      },
      'it-IT': {
        ...
        bindings: [
          {
            currencyCode: 'EUR',
-           url: 'https://brandless.fast.store/it-IT',
+           url: 'http://localhost:3000/it-IT',
            salesChannel: '3',
            isDefault: true,
            locales: [
              {
                code: 'it-IT',
                isDefault: true,
              },
            ],
          },
          {
            currencyCode: 'EUR',
-           url: 'https://brandless.fast.store/europe/it',
+           url: 'http://localhost:3000/europe/it',
            salesChannel: '3',
            isDefault: false,
            locales: [
              {
                code: 'it-IT',
                isDefault: true,
              },
            ],
          },
        ],
      },
      'en-US': {
        code: 'en-US',
        name: 'English',
        languageCode: 'en',
        languageName: 'English',
        script: 'Latn',
        textDirection: 'ltr',
        regionCode: 'US',
        bindings: [
          {
            currencyCode: 'USD',
-           url: 'https://brandless.fast.store',
+           url: 'http://localhost:3000,
            salesChannel: '1',
            isDefault: true,
            locales: [
              {
                code: 'en-US',
                isDefault: true,
              },
            ],
          },
        ],
      },
    ...
}
  • Go to /packages/core and run npmn dev

@codesandbox-ci

codesandbox-ci Bot commented Nov 3, 2025 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@hellofanny hellofanny changed the title chore: changing to acc test feat: multi language Nov 11, 2025
hellofanny and others added 7 commits November 25, 2025 09:15
## What's the purpose of this pull request?

Add the fallback label to hCMS so it can be editable. We need it there
so it can be translated through the CMS.

⚠️ Breaking change: there is no more a hardcoded fallback label, the
message necessarily has to come through CMS.
This PR will be merged in the `feat/multilanguage` feature branch, which
will be available only in the next faststore major version.

## How it works?

It was hardcoded, so adding it to the hCMS schema allows it to be
editable.

## How to test it?

In a Search page, observe the breadcrumb, it should have the value
configured through the hCMS.
<img width="1028" height="501" alt="Screenshot 2025-11-04 at 10 27 49"
src="https://github.com/user-attachments/assets/30d38c18-202c-4fa7-aeb5-5e8416019b4f"
/>

If the field is not being displayed in the hCMS, remember to cms sync
and publish the page.

<img width="1497" height="757" alt="Screenshot 2025-11-04 at 10 37 38"
src="https://github.com/user-attachments/assets/d253597b-5953-4ebd-9931-2c3afb324994"
/>

### Starters Deploy Preview

-
https://storeframework-cm652ufll028lmgv665a6xv0g-77wksgb4k.b.vtex.app/s?q=pizza
([PR](vtex-sites/faststoreqa.store#886))

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2921)
## What's the purpose of this pull request?

Add the Sort by selector labels to hCMS so it can be editable. We need
it there so it can be translated through the CMS.

⚠️ Breaking change: there is no more sort options hardcoded, the values
necessarily have to come through CMS.
This PR will be merged in the `feat/multilanguage` feature branch, which
will be available only in the next faststore major version.

## How it works?

It was hardcoded, so adding it to the hCMS schema allows it to be
editable.

## How to test it?

In a Search page or PLP, observe the Sort by selector, it should have
the values configured through the hCMS.

| PLP | Search |
| ---- | ---- |
| <img width="1031" height="922" alt="Screenshot 2025-11-05 at 09 57 37"
src="https://github.com/user-attachments/assets/40379935-78f7-402c-9020-662bdc824bbe"
/> | <img width="1024" height="915" alt="Screenshot 2025-11-05 at 09 57
55"
src="https://github.com/user-attachments/assets/bde4a107-b6dd-414e-a592-bb29ffae1788"
/> |
| <img width="1502" height="505" alt="Screenshot 2025-11-05 at 14 25 01"
src="https://github.com/user-attachments/assets/f4c6fcbf-b4a1-4f8d-98ec-b49f7dfde6d5"
/> | <img width="1502" height="438" alt="Screenshot 2025-11-05 at 14 25
18"
src="https://github.com/user-attachments/assets/8f0f10aa-b38c-479e-9a09-3d58f9b582d8"
/> |


If the field is not being displayed in the hCMS, remember to cms sync
and publish the page.

### Starters Deploy Preview

- https://brandless-cma5xay4001f6dn4xjwato8b4-4tvja66oo.b.vtex.app/
([PR](vtex-sites/brandless.store#113))

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2915)
Add the invalid quantity toast to hCMS so it can be editable. We need it
there so it can be translated through the CMS.

⚠️ Breaking change: there is no more a hardcoded message, it necessarily
has to come through CMS.
This PR will be merged in the `feat/multilanguage` feature branch, which
will be available only in the next faststore major version.

It was hardcoded, so adding it to the hCMS schema allows it to be
editable.
There are 3 places where it's being used: `SKUMatrixSidebar`,
`SearchProductItem` and `ProductDetailsSettings`, those are related to 2
sections: `Navbar` and `ProductDetails`. So I've updated the schema of
both sections.

In the `brandless` account I've configured through hCMS those messages
and I've enabled the quick order feature so we could test the change in
the Navbar (this feature allows adding products directly to the cart
through search terms).
<img width="250" alt="Screenshot 2025-11-06 at 14 01 25"
src="https://github.com/user-attachments/assets/a890c6d9-5fc7-4b45-b0c9-c0c47afe1f0e"
/>

| Navbar | PDP |
| ---- | ---- |
| <img width="1333" height="376" alt="Screenshot 2025-11-06 at 13 57 31"
src="https://github.com/user-attachments/assets/0c07957a-8075-446f-9921-c112eaabb585"
/> | <img width="1333" height="457" alt="Screenshot 2025-11-06 at 13 57
11"
src="https://github.com/user-attachments/assets/750f7214-313d-4f46-a02c-a0d71b17d39c"
/> |
| <img width="1509" height="577" alt="Screenshot 2025-11-06 at 14 17 37"
src="https://github.com/user-attachments/assets/f93be95e-a0a0-4119-9632-5dbd0e74a215"
/> | <img width="1508" height="501" alt="Screenshot 2025-11-06 at 13 58
35"
src="https://github.com/user-attachments/assets/af49ef79-c80f-491f-8ef9-78a32f30c436"
/> |
| The following SKU Matrix Sidebar is displayed after clicking in
"select multiple" in the search suggestions: <img width="1505"
height="585" alt="Screenshot 2025-11-06 at 15 20 38"
src="https://github.com/user-attachments/assets/66afaae0-6615-4801-b296-5d5e68ab7cf1"
/> | |

- https://brandless-cma5xay4001f6dn4xjwato8b4-95qmbq4tq.b.vtex.app/
([PR](vtex-sites/brandless.store#114))

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2917)
## What's the purpose of this pull request?

Make `ScrollToTopButton` text editable through hCMS by converting it
from a hardcoded component to a CMS-managed section.

**⚠️ Breaking Change**: The `ScrollToTopButton` has been removed from
the PLP template and must now be manually added via hCMS to PLPs.

Print PLP without ScrollToTopButton hardcoded and no setup in hCMS
<img width="1800" height="1014" alt="image"
src="https://github.com/user-attachments/assets/b547a62a-a2d1-4097-abb1-4b86a6e63f01"
/>

## How it works?

Removed hardcoded `ScrollToTopButton` from `ProductListing`. It is now
rendered dynamically via hCMS with configurable text and icon position.

CMS
<img width="680" height="281" alt="Captura de Tela 2025-11-06 às 15 26
49"
src="https://github.com/user-attachments/assets/9b64fe77-d207-4013-b5bf-a5a5305029da"
/>

<img width="1298" height="374" alt="Captura de Tela 2025-11-06 às 15 27
11"
src="https://github.com/user-attachments/assets/20e74ee9-061a-4450-94e7-176b0c0e0425"
/>
<img width="1344" height="511" alt="Captura de Tela 2025-11-06 às 16 20
41"
src="https://github.com/user-attachments/assets/1fc2ccdc-805d-4ee6-8aea-84616aefc159"
/>



## How to test it?

In a Search page or PLP, observe the Scroll to Top Button. It should
have the text and icon position configured through the Headless CMS.


## References

[Jira
task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2916)
## What's the purpose of this pull request?

Add the product comparison sort options to hCMS so it can be editable.
We need it there so it can be translated through the CMS.

⚠️ Breaking change: there is no more hardcoded labels, it necessarily
has to come through CMS.
This PR will be merged in the `feat/multilanguage` feature branch, which
will be available only in the next faststore major version.

## How it works?

It was hardcoded, so adding it to the hCMS schema allows it to be
editable.

## How to test it?

Enable the product comparison feature in Search/PLP through hCMS and
update the sort options labels:
<img width="538" height="200" alt="Screenshot 2025-11-10 at 15 02 45"
src="https://github.com/user-attachments/assets/c9f38ed2-6b9b-40b8-8061-107e8d9a712b"
/>

You can test the Search/PLP on desktop and mobile, choosing some
products to compare and opening the product comparison sidebar.

| Search | PLP |
| ---- | ---- |
| <img width="1001" height="472" alt="Screenshot 2025-11-10 at 15 10 18"
src="https://github.com/user-attachments/assets/a4a61938-82cc-4cda-9f2e-2e24730ea77a"
/> | <img width="996" height="467" alt="Screenshot 2025-11-10 at 15 09
11"
src="https://github.com/user-attachments/assets/47937111-a2b0-41fe-b03b-1a9a51f6e0e8"
/> |
|<img width="1493" height="800" alt="Screenshot 2025-11-10 at 15 17 04"
src="https://github.com/user-attachments/assets/f0686066-d333-4d4e-a497-5ebb80ccdf72"
/> | <img width="1497" height="799" alt="Screenshot 2025-11-10 at 15 15
57"
src="https://github.com/user-attachments/assets/cb6ac62a-7fe7-4f6d-a4b8-17111a1ac86a"
/> |
| <img width="316" height="682" alt="Screenshot 2025-11-10 at 15 17 20"
src="https://github.com/user-attachments/assets/93ebae88-6ba4-4923-b96a-f7847f8408aa"
/> | <img width="318" height="683" alt="Screenshot 2025-11-10 at 15 16
06"
src="https://github.com/user-attachments/assets/14a31321-3bee-42a2-adc5-6dd33725612c"
/> |

### Starters Deploy Preview

- https://brandless-cma5xay4001f6dn4xjwato8b4-3wiqbhrja.b.vtex.app/
([PR](vtex-sites/brandless.store#116))

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2918)
## What's the purpose of this pull request?

Replace `storeConfig.seo.titleTemplate` usage with values provided by
the hCMS so page titles remain configurable via content, while keeping
`discovery.config.js` as fallback to avoid breaking changes.

## How it works?

- Reads `titleTemplate` directly from `settings.seo` (hCMS) on Home and
Landing pages.
- Keeps a fallback to the page title when the template is not present.
- Exposes the `titleTemplate` field in the hCMS schema and updates
`PageContentType`.

## How to test it?

- Publish or edit a page in hCMS setting `settings.seo.titleTemplate`.
- Open the corresponding page and confirm the rendered title follows the
configured template.
<img width="563" height="360" alt="Captura de Tela 2025-11-12 às 17 39
05"
src="https://github.com/user-attachments/assets/39ae34c8-def5-48ed-94b3-320367e31d08"
/>
<img width="489" height="412" alt="Captura de Tela 2025-11-12 às 17 44
29"
src="https://github.com/user-attachments/assets/c4eb64f5-7d28-417e-992d-ccd20dc4a159"
/>



### Starters Deploy Preview
URL Preview:
https://brandless-cma5xay4001f6dn4xjwato8b4-7wpvceise.b.vtex.app/

## References
[Jira
task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2920)
lemagnetic and others added 8 commits December 1, 2025 18:10
## What's the purpose of this pull request?

Currently, the "Min" and "Max" labels and error messages in the
FilterFacetRange component are hardcoded in the code, preventing
customization via hCMS. This PR enables editing these labels and
messages through hCMS, allowing store owners to customize the component
without code changes.

## How it works?

- Adds optional props `minLabel`, `maxLabel`,
`minPriceGreaterThanMaxErrorMessage` and
`maxPriceSmallerThanMinErrorMessage` to the `PriceRange` component
- Extends `FilterFacetRange` to accept and pass through these props
- Creates a new `filters` section in the hCMS schema
(`content-types.json`) with configurations for `filterFacetRange`
- Connects `FilterDesktop` and `FilterSlider` to read hCMS
configurations and pass them to the component

Default values are maintained for backward compatibility if no
configuration is defined in hCMS.

## How to test it?

1. Access hCMS and navigate to the "Filters" section in global settings
2. Configure values for `filterFacetRange`:
   - `minLabel`: Label for the minimum field (e.g., "Min", "From")
   - `maxLabel`: Label for the maximum field (e.g., "Max", "To")
- `minPriceGreaterThanMaxErrorMessage`: Error message when minimum >
maximum
- `maxPriceSmallerThanMinErrorMessage`: Error message when maximum <
minimum
3. Access a PLP/Search page that has a range filter (e.g., price)
4. Verify that custom labels appear in the input fields
5. Test validation by entering invalid values and verify that custom
error messages appear
<img width="1238" height="867" alt="Captura de Tela 2025-11-24 às 10 10
54"
src="https://github.com/user-attachments/assets/42c01133-20b6-4e2e-b794-9909cca47f0e"
/>
<img width="549" height="482" alt="Captura de Tela 2025-11-24 às 10 25
10"
src="https://github.com/user-attachments/assets/a244a7c7-b587-4476-b1d2-2bc1b8dfd88a"
/>



### Starters Deploy Preview


[Preview](https://brandless-cma5xay4001f6dn4xjwato8b4-8zqdtxg3t.b.vtex.app/apparel?category-1=apparel&fuzzy=0&operator=and&price=359.00-to-1347.00&facets=category-1%2Cfuzzy%2Coperator%2Cprice&sort=score_desc&page=0)

## References

- Task:
[SFS-2923](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2923)
- Enable FilterFacetRange labels content in hCMS

[SFS-2923]:
https://vtex-dev.atlassian.net/browse/SFS-2923?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request?

Currently, the search submit button's `aria-label` is hardcoded as
"Submit Search" in the `SearchInput` component code. This PR enables the
configuration of the search submit button's `aria-label` through hCMS,
allowing editors to customize the text as needed.

## How it works?
This PR adds a new `submitButtonAriaLabel` field to the Navbar's
`searchInput` configuration in hCMS. The field allows editors to
configure the `aria-label` text for the search submit button. When not
configured, the default value "Submit Search" is maintained to ensure
compatibility with existing implementations.

## How to test it?
<img width="653" height="588" alt="Captura de Tela 2025-11-25 às 13 44
34"
src="https://github.com/user-attachments/assets/e365d088-2cd0-4152-bb96-8627e9705459"
/>
<img width="913" height="739" alt="Captura de Tela 2025-11-25 às 13 47
46"
src="https://github.com/user-attachments/assets/a82d4ad0-4428-4a3b-9557-6c1217921155"
/>

### Starters Deploy Preview
[Preview](https://sfj-4410414--brandless.preview.vtex.app/)
<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

## References

- Task:
[SFS-2958](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2958)


[SFS-2958]:
https://vtex-dev.atlassian.net/browse/SFS-2958?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Fanny Chien <[email protected]>
## What's the purpose of this pull request?

Add the loading labels to hCMS so they can be editable. We need them
there so they can be translated through the CMS.

⚠️ Breaking change: there are no more hardcoded labels, it necessarily
has to come through CMS.
This PR will be merged in the `feat/multilanguage` feature branch, which
will be available only in the next faststore major version.

## How it works?

It was hardcoded, so adding it to the hCMS schema allows it to be
editable.

There were a lot of places with a loading label hardcoded, I've fixed
those in this PR:
- Label "Loading...":
   - Product Details
   - Search Dropdown
   - AddToCartLoadingSkeleton
   - Checkout page
- Label "loading":
   - OutOfStock
- Label "...":
   - RegionModal
   - RegionPopover
   - RegionSlider

## How to test it?

Sync hCMS, publish all pages/content-types related: Global sections
(Navbar), Global settings (Loading and Regionalization) and the PDP
(ProductDetails section). Then, navigate through the pages and watch for
the use cases.

### hCMS
| Global sections | Global sections settings | PDP |
| ---- | ---- | ---- |
| Navbar <img width="1006" height="541" alt="hCMS - Global Sections -
Navbar"
src="https://github.com/user-attachments/assets/21cb8198-e9db-49aa-a2ba-9f4915e4fd14"
/> | Loading <img width="559" height="598" alt="hCMS - Global Sections -
Settings"
src="https://github.com/user-attachments/assets/09a7ec61-c9e5-4c9a-8e50-000d5d9accc0"
/> | ProductDetails <img width="685" height="708" alt="hCMS -
ProductDetails"
src="https://github.com/user-attachments/assets/c8ff2389-2cb5-42d9-897a-5a583d7febaf"
/> |
| | Regionalization <img width="738" height="823" alt="hCMS - Global
Sections - Settings - Regionalization"
src="https://github.com/user-attachments/assets/88786515-24f7-4e1b-a191-cb9b59605988"
/> | |

### Preview
| PDP | Delivery Promise | Search dropdown (Navbar) | Checkout Page |
| ---- | ---- | ---- | ---- |
| <img width="1807" height="521" alt="ProductDetails -
isClientOfferEnabled isValidating"
src="https://github.com/user-attachments/assets/9c1adab6-7e4c-4917-9129-51d830d4d0fe"
/> condition: `isClientOfferEnabled && isValidating`| RegionModal <img
width="409" height="255" alt="RegionModal"
src="https://github.com/user-attachments/assets/0a61b40e-9073-44db-8709-cec9615aa639"
/> | <img width="890" height="113" alt="SearchDropdown"
src="https://github.com/user-attachments/assets/50b27573-0cea-4c8d-85de-de3c95024f4f"
/> | <img width="455" height="476" alt="Checkout page"
src="https://github.com/user-attachments/assets/259d8354-debd-4e08-aef1-587908a35928"
/> |
| <img width="1560" height="715" alt="ProductDetailsSettings -
isValidating"
src="https://github.com/user-attachments/assets/2fb74be3-d413-48a0-80e3-b2ed3e5c24f6"
/> condition: `isValidating` | RegionPopover <img width="376"
height="280" alt="RegionPopover"
src="https://github.com/user-attachments/assets/79eeb3ca-48cc-445b-aec1-5ebd0ddf8261"
/> | | |
| <img width="1400" height="447" alt="PDP - OutOfStock"
src="https://github.com/user-attachments/assets/b7fb5448-9bb7-45e3-99f9-7bc39b6e9679"
/> condition: using `OutOfStock` component | RegionSlider <img
width="365" height="244" alt="RegionSlider"
src="https://github.com/user-attachments/assets/3c9c96bf-674e-4c8b-a536-f1aafcc43d4a"
/> | | |


### Starters Deploy Preview

- https://brandless-cma5xay4001f6dn4xjwato8b4-9le7ry87q.b.vtex.app/
([PR](vtex-sites/brandless.store#118))
- To test DP related sections:
https://vendemo-cm9sir9v900u7z6llkl62l70j-87xw27y77.b.vtex.app/
([PR](dp-faststore-org/vendemo-dp#114))

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2922)
## What's the purpose of this pull request?

- Adds SDK payload temp to test
The `locales-setting.json` is a temp file that mocks the payload that
the `faststore-sdk` will return with the account's available locales and
settings.
- Handle config from path locales strategy: extract available locales
from `locales-setting.json`

## How it works?

Set `next.config.js` to support url Path locales, cases like
https://www.store.com/en-CA, https://www.store.com/pt-BR

## How to test it?

1. Run the application locally
2. When navigating to `http://localhost:3000` the defaultLocale should
be set.
- check the `<html lang>` attribute. It should be `pt-BR`
<img width="1362" height="216" alt="image"
src="https://github.com/user-attachments/assets/764bf9dd-3b46-43de-9b0a-f2c534cb437e"
/>

3. Then, try navigating to other mapped locales, and check the `lang`
atribute.
- http://localhost:3000/en-CA
<img width="1233" height="301" alt="image"
src="https://github.com/user-attachments/assets/8e6ab112-181a-4d81-841c-877bb91b0d62"
/>

- http://localhost:3000/en-US

<img width="1277" height="328" alt="image"
src="https://github.com/user-attachments/assets/50a3e4e2-36d0-4ffd-af9a-94576c037fae"
/>

- http://localhost:3000/pt-BR 
- http://localhost:3000/fr-CA
- http://localhost:3000/it-IT

All the paths listed above should be valid paths.

### Starters Deploy Preview

## References

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2965)
https://nextjs.org/docs/pages/guides/internationalization
## What's the purpose of this pull request?

Add the ProductDescription aria-label to hCMS so it can be editable. We
need it there so it can be translated through the CMS.

## How it works?

It was hardcoded, so adding it to the hCMS schema allows it to be
editable.

## How to test it?
1. Run this branch locally or use this [preview
link](https://brandless-cma5xay4001f6dn4xjwato8b4-jb9xu2lh7.b.vtex.app/adidas-womens-microdot-polo-night-indigo-70/p)
2. Navigate to a PDP
Check if the Description accordion has a custom aria label different
than `Product Description Content`

<img width="1536" height="164" alt="image"
src="https://github.com/user-attachments/assets/55e89d2f-5d00-45ed-86ba-f23e41b60f55"
/>

3. Or access the cms in admin and try changing the content and publish
<img width="643" height="539" alt="image"
src="https://github.com/user-attachments/assets/58c0765d-b794-4227-8512-3da32ba6c550"
/>

### Starters Deploy Preview
[preview
link](https://brandless-cma5xay4001f6dn4xjwato8b4-jb9xu2lh7.b.vtex.app/adidas-womens-microdot-polo-night-indigo-70/p)

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2979)
@hellofanny
hellofanny changed the base branch from main to canary-v2 December 9, 2025 23:27
lariciamota and others added 7 commits December 10, 2025 14:46
## What's the purpose of this pull request?

Update the i18n next config to handle subdomain locales strategy.

## How it works?

The function `buildI18nDomains` adds the binding URLs domains in the
domains array (i18n next config) if there is no path in the URL.

## How to test it?

Test that the path strategy continues working by accessing the locales
paths, like `/pt-BR`.
To test the domains strategy I configured some routing test domains in
`/etc/hosts`, to do that you can follow these steps:
- In the terminal run `sudo vi /etc/hosts`
- Then edit to add the following config:
```
127.0.0.1  brandless.fast.store.com.br
127.0.0.1  canada.brandless.fast.store
127.0.0.1  brandless.fast.store.com
127.0.0.1  brandless.fast.store
```
- Save it and you'll have something like:
<img width="467" height="272" alt="Screenshot 2025-12-04 at 18 21 45"
src="https://github.com/user-attachments/assets/4ca17234-0f9f-476e-a441-56b657261ef5"
/>

Then, run the core and you can test paths and subdomains strategies
freely.

| Path | Subdomain | 
| ---- | ---- |
| <img width="1496" height="659" alt="path - pt-BR"
src="https://github.com/user-attachments/assets/9308dbef-e5a6-43b2-8ef9-a5aa8baa3385"
/> | <img width="1487" height="616" alt="domain - com br"
src="https://github.com/user-attachments/assets/c4010a17-aa12-4768-bcd3-bba66eae7843"
/> |
| <img width="1465" height="619" alt="path - it-IT"
src="https://github.com/user-attachments/assets/160a2495-7bca-4c7d-a99f-bf2eacd653a3"
/> | <img width="1470" height="639" alt="domain - canada"
src="https://github.com/user-attachments/assets/05c713ee-5eaf-4985-8e20-870221a1198c"
/> |
| <img width="1473" height="619" alt="path - en-CA"
src="https://github.com/user-attachments/assets/264eb405-4341-440f-8a19-d2d2c4c4a473"
/> | <img width="1466" height="638" alt="domain - com"
src="https://github.com/user-attachments/assets/0bf569bf-e8a1-4f66-a4c0-1d606203a60b"
/> |
| <img width="1489" height="616" alt="path - en-US"
src="https://github.com/user-attachments/assets/36d236f7-99e2-4cbf-ac37-ed188451ba46"
/> | |


### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2966)
- [Slack
thread](https://vtex.slack.com/archives/C09CZGYTXEE/p1764883650666369)
## What's the purpose of this pull request?

- Adds `i18nButton` / enables via hCMS
- Adds `Globe` icon
- This button will display the current locale and currency (default
version)
- This button will enable the user to change settings (locale/currency)

note: Adding the `AGENTS.md` file ([ref](https://agents.md)), this is
specifically written for AI assistants to understand the codebase
quickly and provide better help. I created it based on the [FastStore
Components Implementation Guidelines
doc](https://docs.google.com/document/d/1jTDQAkdqZQfe9fkDDI9V74JVgCg1GPktdYArW-UDpTo/edit?tab=t.0#heading=h.tglo77yl0lf5)
and more focused on the components implementation to test.

|desktop|mobile|
|-|-|
|<img width="723" height="79" alt="image"
src="https://github.com/user-attachments/assets/0b516721-7efb-40cb-ba09-13c026e4554d"
/>|<img width="352" height="761" alt="image"
src="https://github.com/user-attachments/assets/3e0a61d8-24a7-459a-80ac-9b83165f73e2"
/>|




## How to test it?
- Enables the button via hCMS, and publish (it's already enabled in the
brandiess acc - if you don't see this section, you might need to run cms
sync and publish again)
<img width="500" height="841" alt="image"
src="https://github.com/user-attachments/assets/86a07ffe-bd82-43c9-938d-27f8e8e0a2f6"
/>

- [desktop] The `i18nButton` should appear in the `Navbar` between the
SearchInput and SignIn button.
- [mobile] The `i18nButton` should appear in the `NavbarSlider` below
the SignIn button.

### Starters Deploy Preview

[preview
link](https://brandless-cma5xay4001f6dn4xjwato8b4-r6ryou7rq.b.vtex.app)

## References

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2888)

---------

Co-authored-by: Leandro Rodrigues <[email protected]>
## What's the purpose of this pull request?

Adds a new CLI command `generate-i18n` that fetches store i18n
configurations (locales, regions, currencies) from the FastStore SDK and
creates/updates the configuration in `discovery.config.default.js`.

## How it works?

1. Searches for `discovery.config.default.js` (root, `.faststore`, or
`--config` path)
2. Validates environment variables (`VTEX_ACCOUNT`,
`FS_DISCOVERY_APP_KEY`, `FS_DISCOVERY_APP_TOKEN`)
3. Fetches i18n config from FastStore SDK
4. Merges with existing config

**Note:** Currently uses `mockedSettings` as the SDK returns old
structure. When SDK is updated, uncomment the real API call.

## How to test it?

**Prerequisites:** Set `VTEX_ACCOUNT`, `FS_DISCOVERY_APP_KEY`,
`FS_DISCOVERY_APP_TOKEN`

```bash
node packages/cli/bin/run.js generate-i18n ./packages/core
```

Verify that `discovery.config.default.js` contains the `i18n` section
and existing properties are preserved.

## References

- **JIRA:**
[SFS-2964](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2964)
- Similar pattern: `cache-graphql.ts`


[SFS-2964]:
https://vtex-dev.atlassian.net/browse/SFS-2964?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
## What's the purpose of this pull request?

Implements a locale/hostname validation system that ensures URLs match
the correct locale configuration based on the hostname. The feature
prevents invalid locale/hostname combinations and returns appropriate
404 responses when configurations don't match.

We want to support multiple locales and they can be configured with
different URL structures:
- **Subdomain bindings**: A hostname dedicated to a locale (e.g.,
`canada.brandless.fast.store` → `fr-CA`)
- **Path-based bindings**: A hostname that serves multiple locales via
paths (e.g., `brandless.fast.store/en-US`, `brandless.fast.store/it-IT`)

Without validation, users could access invalid combinations like:
- `brandless.fast.store/fr-CA/products` → should be 404, as `fr-CA` is
only bound to `canada.brandless.fast.store`
- `canada.brandless.fast.store/en-US/products` → should be 404, as
`en-US` is not bound to this hostname

## How it works?

### SSR & Client-Side Validation

This implementation handles both Server-Side Rendered (SSR) and Static
Site Generated (SSG) pages:

#### SSR Pages (e.g., `/pvt/account/*`)
- **When**: Page uses `getServerSideProps`
- **Where**: Server-side before rendering
- **How**: `withLocaleValidationSSR` HOC wraps `getServerSideProps`
- **Result**: Returns `notFound: true` → Next.js serves 404 page
- **Benefit**: User never sees the invalid page, better SEO

#### SSG Pages (e.g., PLPs, PDPs)
- **When**: Page uses `getStaticProps` (pre-generated at build time)
- **Where**: Client-side after hydration
- **How**: `useEffect` in `_app.tsx` validates after mount
- **Result**: Redirects to `/404` with original path in query string
- **Trade-off**: Page loads before redirect, but SSG pages remain fast

ps.: The same solution from SSR doesn't work on SSG because we don't
have access to hostname on `getStaticProps`.
ps2.: Middleware would work for this use case, but we decided to not use
it to be cost efficient.

#### Validation logic
1. **Localhost bypass**: Allows all locales on `localhost` and
`127.0.0.1` for development tests
2. **Binding check**: Verifies if the locale has a binding for the
hostname
   - Checks all bindings for the given locale
   - Matches if `binding.url` hostname equals the request hostname

## How to test it?
Configure your `etc/hosts` like explained in the previous
[PR](#3143), then test navigating
through the store and changing domains/paths.
In the discovery.config.default, put `enableFaststoreMyAccount` as
`true` to test the `/pvt/account` pages.
### Example Scenarios (based on mock)

#### Valid Combinations ✅
| URL | Type | Result |
| -------------------------------------------- | ---------------- |
------- |
| `brandless.fast.store:3000/pt-BR/apparel` | Path-based | ✅ Valid |
| `brandless.fast.store.com.br:3000/pt-BR` | Subdomain | ✅ Valid |
| `canada.brandless.fast.store:3000/fr-CA` | Subdomain | ✅ Valid |
| `brandless.fast.store:3000/en-US/pvt/account` | Path-based (SSR) | ✅
Valid |

#### Invalid Combinations ❌
| URL | Why Invalid | Result |
| ----------------------------------------------- |
------------------------------------ | -------------- |
| `brandless.fast.store:3000/fr-CA` | fr-CA only bound to canada
subdomain | ❌ 404 (Client) |
| `canada.brandless.fast.store:3000/en-US/apparel` | en-US not bound to
canada subdomain | ❌ 404 (Client) |
| `brandless.fast.store.com:3000/pt-BR/apparel` | pt-BR not bound to
.com | ❌ 404 (Client) |
| `canada.brandless.fast.store:3000/pt-BR/pvt/account` | pt-BR not bound
to canada | ❌ 404 (SSR) |

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2990)
- Slack threads
([1](https://vtex.slack.com/archives/C09CZGYTXEE/p1764883650666369),
[2](https://vtex.slack.com/archives/C09CZGYTXEE/p1765564641414739))
## What's the purpose of this pull request?

- Undo styles change for i18nButton , keep the button default.
- Changes button on navbar desktop to 40px as design tem asked.
note: We should introduce later a new size variant `medium` (40px) to
`Button` component. Then we can remove this change and update the
buttons accordingly.

## How it works?

The i18nButton should have the same default button style.

## How to test it?

1. Run the application and check in the Navbar
- navbar buttons on desktop should have height = 40px
<img width="861" height="114" alt="image"
src="https://github.com/user-attachments/assets/4264cc0b-d490-4640-b1c6-5c3fd5392a41"
/>
- i18n button with default style

|before|now|
|-|-|
|<img width="549" height="93" alt="image"
src="https://github.com/user-attachments/assets/fe0a2c4d-8b12-4eb5-9d63-70daea552d81"
/>|<img width="708" height="80" alt="image"
src="https://github.com/user-attachments/assets/6da060e7-87a3-4251-8b86-5117bc2e4d5d"
/>|
…3162)

## What's the purpose of this pull request?

The `generate-i18n` command was using temporary mocked data exported
from the production code. This PR integrates the real FastStore SDK
`locales()` method, removing the hardcoded mock and making the command
fetch actual i18n configuration.

## How it works?

This PR makes the following changes:

- **Removes mocked data from production code**: The `mockedSettings`
constant was exported from `generate-i18n.ts` and has been removed
- **Integrates real SDK method**: Uncommented and updated the FastStore
SDK integration to use the `locales()` method (updated from the old
`settings()` method)
- **Updates test suite**: Moved the `mockedSettings` to the test file
and properly mocked the SDK's `locales()` method to return test data
- **Removes `locales-setting.jsons` mock data references and uses i18n
settings instead.

The command now correctly fetches real i18n configuration (locales,
regions, currencies) from the VTEX platform when executed with proper
credentials.

## How to test it?

1. Set up the required environment variables
2. Run `node packages/cli/bin/run generate-i18n ./packages/core`
3. Verify that the `discovery.config.default.js` file is updated with
i18n configuration fetched from the SDK
4. Verify if the path strategy continues working by accessing the
locales paths, like `/pt-BR`.
5. Verify if the subdomain strategy continues working by accessing the
urls with locale subdomain

### Starters Deploy Preview
N/A - This is a CLI-only change

## References
[Jira Task]
https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1055?selectedIssue=SFS-2995

---------

Co-authored-by: fanny <[email protected]>
@coderabbitai

coderabbitai Bot commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 181 files, which is 31 over the limit of 150.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 07d1a3f4-0953-498c-b904-93ad17aa0503

📥 Commits

Reviewing files that changed from the base of the PR and between 606159b and 1e52333.

⛔ Files ignored due to path filters (3)
  • AGENTS.md is excluded by none and included by none
  • packages/core/public/icons.svg is excluded by !**/*.svg and included by packages/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
📒 Files selected for processing (181)
  • packages/api/src/platforms/vtex/clients/commerce/index.ts
  • packages/api/src/platforms/vtex/clients/commerce/types/OrderForm.ts
  • packages/api/src/platforms/vtex/resolvers/validateCart.ts
  • packages/api/src/platforms/vtex/resolvers/validateSession.ts
  • packages/cli/README.md
  • packages/cli/package.json
  • packages/cli/src/commands/build.ts
  • packages/cli/src/commands/dev.ts
  • packages/cli/src/commands/generate-i18n.test.ts
  • packages/cli/src/commands/generate-i18n.ts
  • packages/cli/src/index.ts
  • packages/cli/src/utils/config.ts
  • packages/cli/src/utils/generate.ts
  • packages/cli/src/utils/plugins.ts
  • packages/components/src/molecules/Accordion/Accordion.tsx
  • packages/components/src/molecules/Popover/Popover.tsx
  • packages/components/src/molecules/ProductCard/ProductCardContent.tsx
  • packages/components/src/molecules/SearchDropdown/SearchDropdown.tsx
  • packages/components/src/molecules/SearchInputField/SearchInputField.tsx
  • packages/components/src/organisms/Filter/FilterFacetRange.tsx
  • packages/components/src/organisms/OutOfStock/OutOfStock.tsx
  • packages/components/src/organisms/PriceRange/PriceRange.tsx
  • packages/components/src/organisms/ProductComparison/ProductComparisonSidebar.tsx
  • packages/components/src/organisms/SKUMatrix/SKUMatrixSidebar.tsx
  • packages/components/src/organisms/SlideOver/SlideOver.tsx
  • packages/core/cms/faststore/components/cms_component__alert.jsonc
  • packages/core/cms/faststore/components/cms_component__bannernewsletter.jsonc
  • packages/core/cms/faststore/components/cms_component__bannertext.jsonc
  • packages/core/cms/faststore/components/cms_component__breadcrumb.jsonc
  • packages/core/cms/faststore/components/cms_component__cartsidebar.jsonc
  • packages/core/cms/faststore/components/cms_component__children.jsonc
  • packages/core/cms/faststore/components/cms_component__crosssellingshelf.jsonc
  • packages/core/cms/faststore/components/cms_component__emptystate.jsonc
  • packages/core/cms/faststore/components/cms_component__footer.jsonc
  • packages/core/cms/faststore/components/cms_component__hero.jsonc
  • packages/core/cms/faststore/components/cms_component__incentives.jsonc
  • packages/core/cms/faststore/components/cms_component__navbar.jsonc
  • packages/core/cms/faststore/components/cms_component__newsletter.jsonc
  • packages/core/cms/faststore/components/cms_component__productdetails.jsonc
  • packages/core/cms/faststore/components/cms_component__productgallery.jsonc
  • packages/core/cms/faststore/components/cms_component__productshelf.jsonc
  • packages/core/cms/faststore/components/cms_component__producttiles.jsonc
  • packages/core/cms/faststore/components/cms_component__regionbar.jsonc
  • packages/core/cms/faststore/components/cms_component__regionmodal.jsonc
  • packages/core/cms/faststore/components/cms_component__regionpopover.jsonc
  • packages/core/cms/faststore/components/cms_component__scrolltotopbutton.jsonc
  • packages/core/cms/faststore/components/cms_component__search.jsonc
  • packages/core/cms/faststore/content-types.json
  • packages/core/cms/faststore/pages/cms_content_type__globalsections.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__home.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__landingpage.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__pdp.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__plp.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__search.jsonc
  • packages/core/cms/faststore/schema.json
  • packages/core/cms/faststore/sections.json
  • packages/core/discovery.config.default.js
  • packages/core/next.config.js
  • packages/core/package.json
  • packages/core/scripts/i18n.js
  • packages/core/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawer.tsx
  • packages/core/src/components/cart/CartSidebar/CartSidebar.tsx
  • packages/core/src/components/cart/EmptyCart/EmptyCart.tsx
  • packages/core/src/components/cms/GlobalSections.tsx
  • packages/core/src/components/cms/RenderSections.tsx
  • packages/core/src/components/cms/plp/Components.ts
  • packages/core/src/components/localization/LocalizationSelector/LocalizationSelector.tsx
  • packages/core/src/components/localization/LocalizationSelector/index.ts
  • packages/core/src/components/localization/LocalizationSelector/section.module.scss
  • packages/core/src/components/localization/index.ts
  • packages/core/src/components/navigation/Navbar/Navbar.tsx
  • packages/core/src/components/navigation/NavbarSlider/NavbarSlider.tsx
  • packages/core/src/components/product/OutOfStock/OutOfStock.tsx
  • packages/core/src/components/product/ProductCard/ProductCard.tsx
  • packages/core/src/components/region/RegionModal/RegionModal.tsx
  • packages/core/src/components/region/RegionPopover/RegionPopover.tsx
  • packages/core/src/components/region/RegionSlider/RegionSlider.tsx
  • packages/core/src/components/search/Filter/FilterDeliveryMethodFacet.tsx
  • packages/core/src/components/search/Filter/FilterDesktop.tsx
  • packages/core/src/components/search/Filter/FilterSlider.tsx
  • packages/core/src/components/search/SearchDropdown/SearchDropdown.tsx
  • packages/core/src/components/search/SearchHistory/SearchHistory.tsx
  • packages/core/src/components/search/SearchInput/SearchInput.tsx
  • packages/core/src/components/search/SearchProductItem/SearchProductItem.tsx
  • packages/core/src/components/search/SearchTop/SearchTop.tsx
  • packages/core/src/components/search/Sort/Sort.tsx
  • packages/core/src/components/sections/Alert/Alert.tsx
  • packages/core/src/components/sections/Breadcrumb/Breadcrumb.tsx
  • packages/core/src/components/sections/Footer/Footer.tsx
  • packages/core/src/components/sections/Hero/Hero.tsx
  • packages/core/src/components/sections/Navbar/Navbar.tsx
  • packages/core/src/components/sections/ProductDetails/ProductDetails.tsx
  • packages/core/src/components/sections/ProductGallery/EmptyGallery.tsx
  • packages/core/src/components/sections/ScrollToTopButton/ScrollToTopButton.tsx
  • packages/core/src/components/templates/LandingPage/LandingPage.tsx
  • packages/core/src/components/templates/ProductListingPage/ProductListing.tsx
  • packages/core/src/components/templates/ProductListingPage/ProductListingPage.tsx
  • packages/core/src/components/ui/Breadcrumb/Breadcrumb.tsx
  • packages/core/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx
  • packages/core/src/components/ui/Button/ButtonSignIn/ButtonSignInFallback/ButtonSignInFallback.tsx
  • packages/core/src/components/ui/Link/Link.tsx
  • packages/core/src/components/ui/LinkButton/LinkButton.tsx
  • packages/core/src/components/ui/LinkButton/index.ts
  • packages/core/src/components/ui/LocalizationButton/LocalizationButton.tsx
  • packages/core/src/components/ui/LocalizationButton/index.ts
  • packages/core/src/components/ui/PickupPoints/PickupPointCards.tsx
  • packages/core/src/components/ui/ProductComparison/ProductComparisonSidebar.tsx
  • packages/core/src/components/ui/ProductDescription/ProductDescription.tsx
  • packages/core/src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx
  • packages/core/src/components/ui/ProductDetails/ProductDetailsSettings.tsx
  • packages/core/src/components/ui/ProductGallery/ProductGallery.tsx
  • packages/core/src/components/ui/ShippingSimulation/ShippingSimulation.tsx
  • packages/core/src/experimental/myAccountServerSideProps.ts
  • packages/core/src/experimental/searchServerSideFunctions/getServerSideProps.ts
  • packages/core/src/experimental/searchServerSideFunctions/getStaticProps.ts
  • packages/core/src/middleware.ts
  • packages/core/src/middleware__DISABLED.ts
  • packages/core/src/pages/404.tsx
  • packages/core/src/pages/500.tsx
  • packages/core/src/pages/[...slug].tsx
  • packages/core/src/pages/[slug]/p.tsx
  • packages/core/src/pages/_app.tsx
  • packages/core/src/pages/checkout.tsx
  • packages/core/src/pages/index.tsx
  • packages/core/src/pages/login.tsx
  • packages/core/src/pages/pvt/account/403.tsx
  • packages/core/src/pages/pvt/account/404.tsx
  • packages/core/src/pages/pvt/account/index.tsx
  • packages/core/src/pages/pvt/account/orders/[id].tsx
  • packages/core/src/pages/pvt/account/orders/index.tsx
  • packages/core/src/pages/pvt/account/profile.tsx
  • packages/core/src/pages/pvt/account/security.tsx
  • packages/core/src/pages/pvt/account/user-details.tsx
  • packages/core/src/pages/s.tsx
  • packages/core/src/sdk/account/refreshToken.ts
  • packages/core/src/sdk/analytics/platform/vtex/search.ts
  • packages/core/src/sdk/deliveryPromise/useDeliveryPromise.ts
  • packages/core/src/sdk/localization/bindingSelector.ts
  • packages/core/src/sdk/localization/index.ts
  • packages/core/src/sdk/localization/match-url.ts
  • packages/core/src/sdk/localization/types.ts
  • packages/core/src/sdk/localization/useBindingSelector.ts
  • packages/core/src/sdk/localization/useLocaleValidation.ts
  • packages/core/src/sdk/localization/useLocalizationConfig.tsx
  • packages/core/src/sdk/offer/fetcher.ts
  • packages/core/src/sdk/product/useLocalizedVariables.ts
  • packages/core/src/sdk/product/useProductLink.ts
  • packages/core/src/sdk/search/formatSearchPath.ts
  • packages/core/src/sdk/search/state.ts
  • packages/core/src/sdk/search/useSearchBase.ts
  • packages/core/src/sdk/search/useSearchHistory.ts
  • packages/core/src/sdk/shipping/useShippingSimulation.ts
  • packages/core/src/sdk/tsconfig.json
  • packages/core/src/sdk/ui/useLink.ts
  • packages/core/src/server/cms/global.ts
  • packages/core/src/server/cms/index.ts
  • packages/core/src/server/cms/pdp.ts
  • packages/core/src/server/cms/plp.ts
  • packages/core/src/server/content/service.ts
  • packages/core/src/server/content/types.ts
  • packages/core/src/typings/locales.ts
  • packages/core/src/utils/fetchProductGallerySSR.ts
  • packages/core/src/utils/getBaseDomain.ts
  • packages/core/src/utils/globalSettings.ts
  • packages/core/src/utils/localization/customPaths.ts
  • packages/core/src/utils/validateLocaleForHostname.ts
  • packages/core/src/utils/withLocaleValidation.ts
  • packages/core/test/sdk/localization/bindingSelector.test.ts
  • packages/core/test/sdk/localization/store-url.browser.test.ts
  • packages/core/test/sdk/localization/store-url.test.ts
  • packages/core/test/sdk/localization/useBindingSelector.test.tsx
  • packages/core/test/sdk/search/useSearchHistory.test.ts
  • packages/core/test/utils/localization/customPaths.test.ts
  • packages/core/test/utils/match-url.test.ts
  • packages/core/vitest.config.ts
  • packages/ui/src/components/molecules/Popover/styles.scss
  • packages/ui/src/components/organisms/LocalizationSelector/styles.scss
  • packages/ui/src/components/organisms/Navbar/styles.scss
  • packages/ui/src/components/organisms/NavbarSlider/styles.scss
  • packages/ui/src/components/organisms/SlideOver/styles.scss
  • packages/ui/src/styles/components.scss

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/multilanguage

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

## What's the purpose of this pull request?

This PR implements a new `I18nSelector` component that allows users to
select their preferred language and currency. The component provides a
seamless experience across devices, using a Popover on desktop and a
SlideOver on mobile. All UI texts are configurable through the CMS,
making it easy for store administrators to customize the experience for
their audience.

## How it works?

The implementation consists of several key components and enhancements:

### Core Components

1. **I18nSelector Component**
(`packages/core/src/components/i18n/I18nSelector/`)
- Responsive component that switches between Popover (desktop) and
SlideOver (mobile) based on screen size
   - Manages language and currency selection state
- Receives all content (languages, currencies, labels, descriptions) via
props
- Includes a reusable `I18nSelectorContent` subcomponent for the form
fields

2. **I18nButton Component** (updated)
   - Button that triggers the I18nSelector
   - Displays current locale and currency (e.g., "EN/BRL")
   - Receives configuration from CMS via Navbar section
   - Uses default English texts when CMS values are not provided

### Library Enhancements

3. **Popover Component** (enhanced)
- Added optional portal rendering support via `usePortal` prop (default:
`false`)
   - Added `wrapperProps` for customizing the portal wrapper div
- Uses `position: fixed` when portal is enabled for accurate viewport
positioning
   - Maintains backward compatibility with existing implementations

4. **SlideOver Component** (enhanced)
   - Added new `bottomSide` direction for bottom-to-top animations
   - Supports vertical slide animations with proper CSS transitions
- Works seamlessly with existing `leftSide` and `rightSide` directions

### CMS Integration

5. **CMS Configuration** (`sections.json`)
   - Added `i18nSelector` object in Navbar navigation schema
- Configurable fields: `title`, `languageLabel`, `currencyLabel`,
`description`, `saveLabel`
   - All fields have English defaults
   - Separate from `i18nButton` configuration for better organization

### User Experience

- **Desktop**: Popover appears below the I18nButton with form fields and
save button
- **Mobile**: SlideOver slides up from the bottom with header, content,
and footer

## How to test it?
Link Preview

### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!-- Link will be added after preview is generated -->

## References

- **Jira Issue**:
[SFS-2889](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2889)


[SFS-2889]:
https://vtex-dev.atlassian.net/browse/SFS-2889?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
hellofanny and others added 4 commits February 19, 2026 11:08
## What's the purpose of this pull request?

Includes the locale as client preferences information to the orderForm,
so can be retrieved in checkout and enable the translation.

## How it works?

`storepreferencesdata`
[ref](https://developers.vtex.com/docs/guides/orderform-fields#storepreferencesdata):
This object contains data from the store's configuration. This is
already updated with the session salesChannel/store info.

`clientPreferencesData`
[ref](https://developers.vtex.com/docs/guides/orderform-fields#clientpreferencesdata):
Object containing preferences from the client who placed the order. Pass
the current session locale to enable translation in checkout.

## How to test it?

We will simulate the checkout update, run the project locally, enable
localization and run the binding setup.

1.  Using the current locale en-US / sc=1
2. Change locale to pt-BR (sc=2)
3. Add a new item in the cart 
4. Check if `storePreferencesData` and `clientPreferencesData.locale`
fields form orderForm has been updated.


https://github.com/user-attachments/assets/8f419d7c-93db-4cec-9b8f-73963e580292

## References

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2983)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Session locale now automatically syncs with the shopping cart for
consistent language.
* You can save client preferences (locale and newsletter opt-in) to the
cart/order form so language and subscription choices persist across
sessions.
* **Improvements**
* Locale synchronization runs as an additional validation step to keep
cart data up to date.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…ig (#3207)

## What's the purpose of this pull request?

On the PLP (Product Listing Page), the locale used for search and
product gallery came from `discovery.config` (session), which is fixed
per environment. In multi-language stores, this prevented search and
products from matching the current route’s language. This PR makes the
PLP use the page locale from Next.js so search and content align with
the URL locale.

## How it works?

- In `[...slug].tsx`, the `locale` already available in Next’s
`getStaticProps` is passed into `fetchServerManyProducts`.
- In `fetchProductGallerySSR.ts`, `fetchServerManyProducts` now accepts
`locale` as a parameter and no longer uses `storeConfig.session.locale`.
PLP search/SSR for the gallery uses the route locale (e.g. `/en-US/...`,
`/pt-BR/...`).

## How to test it?
N/A

### Starters Deploy Preview
N/A

## References

[Jira](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3032)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Product gallery server-side data fetching now consistently accepts and
propagates locale so region-specific product data is retrieved during
SSR.

* **Bug Fix / Improvement**
* Product page data queries now include locale, improving accuracy of
displayed products for different regions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

- updates schema
- fix log error ` Invalid attribute name: `$componentKey`/
`$componentTitle` Error Component Stack`
<img width="543" height="513" alt="image"
src="https://github.com/user-attachments/assets/3f6a8b2b-fdfc-4cfe-a36d-cf54c1df43a3"
/>

## How it works?

Filter CMS metadata props so they are not passed to section components
(and thus to the DOM).

## How to test it?

1. run the project locally using the localization: enabled /
contentSource: CP
2. The error shown above should not appear anymore 



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added ScrollToTopButton component to the CMS with customizable text
and icon position settings.

* **Bug Fixes**
* Fixed internal CMS metadata appearing in the rendered DOM output of
section components, improving page structure cleanliness.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@hellofanny hellofanny changed the title feat: multi language feat: Enables localization feature Feb 20, 2026
## What's the purpose of this pull request?

Uses `name` instead of `languageName` to display the language's native
name.

- `name` – native language label: "português", "italiano", "English",
"français"
- `languageName` – English label: "Portuguese", "Italian", "English",
"French"

|before|now|
|-|-|
<img width="463" height="475" alt="image"
src="https://github.com/user-attachments/assets/c9e07a8f-ee41-4674-b13d-a2171e807b39"
/>|<img width="506" height="482" alt="image"
src="https://github.com/user-attachments/assets/43b42c61-22d8-416f-9aa5-b4e416b11056"
/>


## How to test it?
- Run the project locally and check if the locale selector shows the
language native names.

## References
https://vtex.slack.com/archives/C09CZGYTXEE/p1771515982049669

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Language selection now shows capitalized native locale names and
appends region codes only when needed to disambiguate.
* **Tests**
* Updated test expectations and descriptions to match native-name
labeling and capitalization.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

Fix error after merging with sass updates.

<img width="825" height="897" alt="image"
src="https://github.com/user-attachments/assets/cc213cb3-02fe-4fe7-b4a3-91a4bce5de2a"
/>


Nothing changed ✅ 
<img width="468" height="878" alt="image"
src="https://github.com/user-attachments/assets/4f7a7290-7c99-4ca7-ba1d-9bd037f1456a"
/>



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Updated internal styling utilities organization in the localization
selector component for improved code structure.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
hellofanny and others added 7 commits February 20, 2026 17:57
## What's the purpose of this pull request?

- Centralize link resolution so internal links always get the correct
locale/context: either a custom path prefix (e.g. /europe/it/...) when
on a custom path page, or the Next.js locale prefix (e.g. /pt-BR/...)
when localization is enabled and the current locale is not the default.

- Keep search URLs aligned with the rest of the application: when search
state is applied, the URL written is resolved through the same logic so
it keeps the current locale or custom path instead of always using `/s`.

Problematic behaviour:


https://github.com/user-attachments/assets/eae08a3c-09c9-480a-b0fb-0d6dd611a1ef




## How it works?

### `useLink`
- For internal paths (/...), resolveLink(href):
1. Calls addCustomPathPrefix(href, asPath) so links get the current
custom path prefix when the user is on a custom-path page (e.g.
/europe/it).
2. If no custom path was applied and localization is enabled, the
current locale is not the default, and the user is not on a custom-path
page, it prepends the Next.js locale (e.g. /pt-BR/s).
3. Otherwise it returns the path unchanged. External or non-absolute
URLs are returned as-is. When localization is disabled, internal links
are returned unchanged.
4. `OnCustomPath` check when the current page is under a custom path, so
we don’t add the Next.js locale segment on those pages (locale is
already in the path).

### Search state
`useApplySearchState` runs the new search URL through resolveLink()
before calling replaceState, so the URL in the url and history keeps the
correct locale or custom path (e.g. /europe/it/s?q=shoes or
/pt-BR/s?q=shoes instead of /s?q=shoes when that would be wrong).


## How to test it?

Use the instructions [here](#3093)
to run the project locally and set the binding and enable localization.

Scenario 1: 
- Go to a non-default locale (e.g. http://localhost:3000/pt-BR).
- Click internal links and run a search.
- Links and search URL should keep the locale prefix (e.g.
/pt-BR/s?q=..., /pt-BR/product/p).



https://github.com/user-attachments/assets/75a6f95c-d203-4a15-aa12-986b49611ce2


Scenario 2: With custom paths
- Go to custom path (e.g. http://localhost:3000/america/fr).
- Click internal links and run a search.
- Links and search URL should keep the custom path prefix (e.g.
/america/fr/s?q=...).



https://github.com/user-attachments/assets/44b57b9e-869d-4552-8f68-75f27050a512


note: we still need to adjust the search history scenario, it will
redirect to the "correct" url, but we are currently saving all the
search history terms using the same locale key. ([task](SFS-2890) to
address it)
<img width="1542" height="465" alt="image"
src="https://github.com/user-attachments/assets/81553ffd-9296-407b-a372-d8c1a1107f55"
/>


## References

Jira Tasks:
- [SFS-3041](https://vtex-dev.atlassian.net/browse/SFS-3041)
- [SFS-3051](https://vtex-dev.atlassian.net/browse/SFS-3051)

[SFS-3041]:
https://vtex-dev.atlassian.net/browse/SFS-3041?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Search components now use a hook-based path formatter and consistent
resolved URLs for navigation, improving behavior across inputs,
suggestions, and top results.
* Link resolution was enhanced to preserve locale and custom-path
context when building hrefs.

* **New Features**
* Added a search base resolver hook to ensure localized search links
honor custom prefixes.

* **Chores**
  * Exported the custom-path extractor for reuse.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
… is true (#3216)

## What's the purpose of this pull request?

Stores with localization disabled (`localization.enabled: false`) in
discovery config were still initializing the `useLocalizationConfig`
hook, which accesses `config.localization.locales` and could cause
unnecessary behavior or errors. The goal is to initialize this hook only
when the localization feature is enabled in discovery config.

## How it works?

- Introduced a `LocalizationConfigUpdater` component that wraps the
`useLocalizationConfig` hook
- The component is conditionally rendered only when
`storeConfig.localization?.enabled` is `true`
- Uses the component wrapper pattern to follow [React's Rules of
Hooks](https://react.dev/reference/rules/rules-of-hooks), avoiding
conditional hook calls

When `localization.enabled` is `false`, the component is not mounted and
the hook is not executed.

## How to test it?

- With `localization.enabled: true` in `discovery.config`, confirm the
session is updated based on the binding/region
- With `localization.enabled: false` in `discovery.config`, confirm the
app starts without errors and no localization logic is initialized

### Starters Deploy Preview
N/A
<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References
- Task:
[SFS-3049](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3049)



[SFS-3049]:
https://vtex-dev.atlassian.net/browse/SFS-3049?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Localization initialization now runs only when the localization
feature is enabled, ensuring localization setup is performed
conditionally.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ssage (#3222)

## What's the purpose of this pull request?

The `generate-i18n` CLI command was loading credentials from `.env`
instead of `vtex.env`, which is the FastStore-specific environment file.
Additionally, the error message shown when credentials are missing was
too vague, not telling developers where to look or what to do next.

## How to test it?

Running `node packages/cli/bin/run generate-i18n ./packages/core`, test
with and without the variables on `vtex.env`.

Or through a test account, running the build command:

<img width="700" alt="Screenshot 2026-02-25 at 10 07 40"
src="https://github.com/user-attachments/assets/12d1209d-dfc6-406e-8786-4dfb3e51fccf"
/>

### Starters Deploy Preview

PR: vtex-sites/brandless.store#148 
Even without the `vtex.env` it worked on production since those
variables were set in Webops Settings:
<img width="500" alt="Screenshot 2026-02-25 at 10 08 35"
src="https://github.com/user-attachments/assets/86550e20-39c4-4998-a973-c4c7509471c5"
/>

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-3048)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved credentials validation for the i18n command with clearer
error messaging and earlier checks to fail fast.
* Environment file loading now occurs conditionally at runtime,
improving detection and configuration behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

Stores with multiple locales shared one search history. This PR stores
history **per locale** so each language has its own list.

## How it works?

- Same IndexedDB key `fs::searchHistory`, but value is now
`Record<locale, History[]>` (e.g. `{ "en-US": [...], "pt-BR": [...] }`).
- `useSearchHistory` uses `useSession().locale` to read/write only the
current locale. Public API unchanged.
- Legacy array format is migrated on first load to the new shape (array
→ `{ defaultLocale: [...] }`).

## How to test it?

1. Run the store (`pnpm dev`).
2. In locale A: search a few terms, focus search again → history
appears.
3. Switch to locale B → history is empty (or only B’s terms).
4. Search in B, focus → only B’s terms. Switch back to A → A’s history
still there.
5. (Optional) DevTools → Application → IndexedDB → `fs::searchHistory` →
object with one key per locale.

<img width="1763" height="975" alt="image"
src="https://github.com/user-attachments/assets/abbb2d36-f8ba-48cf-aa74-c7f7e70bc362"
/>


### Starters Deploy Preview

https://brandless-cma5xay4001f6dn4xjwato8b4-mw8252v1z-vtex-fs.vercel.app/it-IT

https://brandless-cma5xay4001f6dn4xjwato8b4-mw8252v1z-vtex-fs.vercel.app/pt-BR
<!--- Add link to starter.store deploy preview for this branch. --->

## References

-
[SFS-2890](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2890)


[SFS-2890]:
https://vtex-dev.atlassian.net/browse/SFS-2890?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Search history is now locale-aware: each language/locale keeps its own
history and changes are isolated per locale.
* Legacy array-based histories are migrated automatically to the
locale-based format.

* **Behavior Improvements**
* History entries are deduplicated, newest-first, and capped to a
maximum size.
  * Clearing history removes only the active locale’s entries.

* **Tests**
* Comprehensive tests added for locale-aware history, migration,
deduplication, limits, and clearing behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

When navigating a store in a non-default locale (e.g.,
`store.com/pt-BR`), clicking the Sign In button redirected to `/login`
instead of `/pt-BR/login`. This caused the store to lose the locale
context and render in the default language. The same issue affected any
LinkButton in core whose href was a hardcoded internal path.

## How it works?

A new locale-aware `LinkButton` wrapper was created at the core,
mirroring the existing Link pattern in core.
The wrapper intercepts the href prop and, for any internal path
(starting with `/`), runs it through `resolveLink` from `useLink`. This
applies the current locale prefix automatically — whether that's a
Next.js locale segment (e.g., `/pt-BR/login`) or a custom path prefix
(e.g., `/brasil/login`) — while leaving external URLs untouched.
Components updated to use the new wrapper:
- ButtonSignIn — /login 
- ButtonSignInFallback — /login (Suspense fallback)
- EmptyGallery — button URLs (comes from CMS)

Going forward, any `LinkButton` in core should import from
`src/components/ui/LinkButton` instead of `@faststore/ui`, just as
`Link` is imported from `src/components/ui/Link`.

## How to test it?

- Run with localization enabled and test a non-default locale (e.g.,
en-US as default, pt-BR as secondary)
- Navigate to the store under the secondary locale path (e.g.,
store.com/pt-BR)
- Click the Sign In button in the navbar
Before fix: redirected to /login (default locale, page renders in
English)
After fix: redirected to /pt-BR/login (locale preserved)
Repeat with a store using a custom path prefix (e.g., /brasil) to verify
the custom path is also applied

### Starters Deploy Preview

 ([PR](vtex-sites/brandless.store#150))

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-3052)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* New LinkButton component with automatic locale-aware URL resolution
for internal links.

* **Refactor**
* Updated multiple UI components to use the new LinkButton component for
consistent internal link handling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@lemagnetic
lemagnetic marked this pull request as ready for review March 4, 2026 20:51
@lemagnetic
lemagnetic requested a review from a team as a code owner March 4, 2026 20:51
@lemagnetic
lemagnetic requested review from emersonlaurentino and lemagnetic and removed request for a team March 4, 2026 20:51
@lemagnetic
lemagnetic merged commit 31891e6 into canary-v2 Mar 5, 2026
2 of 3 checks passed
@lemagnetic
lemagnetic deleted the feat/multilanguage branch March 5, 2026 14:11
hellofanny added a commit that referenced this pull request Apr 23, 2026
## What's the purpose of this pull request?

This PR attempts to fix the duplicate SKU selectors when switching the
locales.

|before|after|
|-|-|
|<img width="1446" height="854" alt="image"
src="https://github.com/user-attachments/assets/ca45f834-2ec3-4fe5-8167-b6c1409feeac"
/>|<img width="1349" height="774" alt="image"
src="https://github.com/user-attachments/assets/d6ee28eb-f092-4eb1-aa45-747598550a82"
/>|

## How it works?

`mergePdpData` uses deepmerge with overwriteMerge for arrays, then
overrides `product.isVariantOf.skuVariants` with the client payload when
the client sends skuVariants. That way localized keys in
availableVariations are not accumulated across server and client; the
client’s skuVariants wins and the UI renders a single selector block.

## How to test it?
- Run the project locally, enabling the localization feature as
explained [here](#3093)
- Open the Nike Men's Air Max 1 G Spikeless Golf Shoes PDP 
- Switch the locale to pt-BR or it-IT
- It should display one sku selector according to the current locale.




https://github.com/user-attachments/assets/ea9f2acb-3d04-4869-b7b2-0cf024904791


### Starters Deploy Preview

[preview link](https://sfj-e5c612c--brandless.preview.vtex.app)
[PR](vtex-sites/brandless.store#159)

## References


https://vtex-dev.atlassian.net/browse/SFS-3094?atlOrigin=eyJpIjoiYjZmYWFkNTJhYWU2NDA5MzgxNTcyMzBjMzgwYmNlMDMiLCJwIjoiaiJ9

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved product variant data handling to ensure correct merging of
SKU information from multiple sources.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants