Use the Host Site Language in ECv2

This setting is only available in Enhanced Web Chat v2 (ECv2) on Lightning Web Runtime (LWR) sites.

Important

By default, the Enhanced Chat client loads inside an iframe with the language attribute set to English. This default prevents the chat client from inheriting the host site’s language and can cause base Lightning components to render in the wrong language. To have Enhanced Chat v2 inherit the language configured on your Experience Cloud site, enable the useHostSiteLanguage setting snippet.

This setting is opt-in to prevent unintended changes to existing deployments.

Note

For the syntax and default value, see useHostSiteLanguage in the Settings reference.

Prerequisites 

Before you enable useHostSiteLanguage, add each language you want to support to your LWR site. To add a language to your LWR site, see Add a Language to Your LWR Site in the Experience Cloud Developer Guide.

The ECv2 runtime can’t validate whether a language is supported by your site, so you must configure the languages in your digital experience first. If you skip these steps, users can encounter 404 errors when the chat client attempts to load an unsupported language.

Troubleshooting 

  • 404 errors when the chat client loads: If users see 404 errors, the requested language isn’t configured on the LWR site. Confirm that you completed the prerequisite steps in Add a Language to Your LWR Site for each language you want to support.
  • Chat still loads in English after enabling the setting: Verify that the host site’s active language matches a language you’ve added to the LWR site, and that the deployment was republished after you enabled the setting.