Search code examples
spartacus-storefront

Spartacus Change Language to User Default Language while Login


I am trying to set the language from the Session language set for Customer in CX. This value is set during the login through CDC.

How can I send the same language in all the requests to the Backend OCC call from Spartacus?


Solution

  • Language settings are set in src/app/app.module.ts

    For example:

    B2cStorefrontModule.withConfig({
      ...
      context: {
        currency: ['USD'],
        language: ['en'],
        baseSite: ['electronics-spa'],
      },
      ...
    }),