Skip to content

feat: Add loading labels to hCMS - #3116

Merged
lariciamota merged 5 commits into
feat/multilanguagefrom
feat/loading-labels-hcms
Dec 2, 2025
Merged

lariciamota merged 5 commits into
feat/multilanguagefrom
feat/loading-labels-hcms

Conversation

@lariciamota

@lariciamota lariciamota commented Nov 12, 2025 •

Copy link
Copy Markdown
Contributor

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 hCMS - Global Sections - Navbar Loading hCMS - Global Sections - Settings ProductDetails hCMS - ProductDetails
Regionalization hCMS - Global Sections - Settings - Regionalization

Preview

PDP Delivery Promise Search dropdown (Navbar) Checkout Page
ProductDetails - isClientOfferEnabled   isValidating condition: isClientOfferEnabled && isValidating RegionModal RegionModal SearchDropdown Checkout page
ProductDetailsSettings - isValidating condition: isValidating RegionPopover RegionPopover
PDP - OutOfStock condition: using OutOfStock component RegionSlider RegionSlider

Starters Deploy Preview

References

@lariciamota lariciamota self-assigned this Nov 12, 2025
@lariciamota lariciamota added the enhancement New feature or request label Nov 12, 2025
@codesandbox-ci

codesandbox-ci Bot commented Nov 12, 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 force-pushed the feat/product-comparison-sort-options-cms branch from cb2bcca to d86aa21 Compare November 17, 2025 14:27
Base automatically changed from feat/product-comparison-sort-options-cms to feat/multilanguage November 17, 2025 15:54
@lariciamota
lariciamota force-pushed the feat/loading-labels-hcms branch from 95e2aa6 to 2bb3c28 Compare November 21, 2025 15:00
@lariciamota
lariciamota force-pushed the feat/loading-labels-hcms branch from 46d9e3b to 942560c Compare November 25, 2025 12:15
@lariciamota
lariciamota marked this pull request as ready for review December 1, 2025 13:29
@lariciamota
lariciamota requested a review from a team as a code owner December 1, 2025 13:29
@lariciamota
lariciamota requested review from ommeirelles and renatamottam and removed request for a team December 1, 2025 13:29

@eduardoformiga eduardoformiga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lariciamota
lariciamota force-pushed the feat/loading-labels-hcms branch from 9168893 to 2d85352 Compare December 2, 2025 12:57
@lariciamota
lariciamota merged commit b95eca2 into feat/multilanguage Dec 2, 2025
@lariciamota
lariciamota deleted the feat/loading-labels-hcms branch December 2, 2025 13:07
lemagnetic added a commit that referenced this pull request Mar 5, 2026
## What's the purpose of this pull request?

Removing hardcoded labels:
- #3099
- #3102 
- #3107 
- #3104 
- #3103 
- #3125
- #3131
- #3116
- #3142
- #3192

Setting Up locales
- #3141
- #3143
- #3147
- #3156
- #3162
- #3145
- #3164
- #3169
- #3171
- #3176
- #3180
- #3169
 custom path
- #3185
- #3162
- #3156
- #3170

Components
- #3093
- #3175

Fetching content 

- #3165

Others
- #3176
- #3171
- #3181
- #3189
- #3205


## 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.

```diff
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`

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: Otavio Moreira Meirelles <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

4 participants